472,779 Members | 2,266 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,779 software developers and data experts.

Asp .Net: display selectedvalue in compobox placed in a grid

hi,
I am using dropdownlist in webgrid.for loading the combo i am using this source code.

Expand|Select|Wrap|Line Numbers
  1. Dim vallist As New Infragistics.WebUI.UltraWebGrid.ValueList
  2.             Dim ds As New DataSet
  3.             ds = _Utility.runsql("select " + IDField + "," + TextField + " from " + TableName + " where Deleted=0")
  4.             Dim dt As New DataTable
  5.             dt.Columns.Add("unit_id")
  6.             dt.Columns.Add("unit_name")
  7.             If ds.Tables(0).Rows.Count > 0 Then
  8.                 dt.Rows.Add("", "")
  9.             End If
  10.             For i As Integer = 0 To ds.Tables(0).Rows.Count - 1
  11.                 dt.Rows.Add(ds.Tables(0).Rows(i).Item(0).ToString, ds.Tables(0).Rows(i).Item(1).ToString)
  12.             Next
  13.             vallist.DataSource = dt
  14.             vallist.DisplayMember = TextField
  15.             vallist.DataMember = IDField
  16.             vallist.ValueMember = IDField
  17.             vallist.DataBind()
  18.             Column.Type = Infragistics.WebUI.UltraWebGrid.ColumnType.DropDownList
  19.             Column.ValueList = vallist
After loading the combo ,i am selected the item.If i click the submit button automatically the selected value will be changed as number.In webgrid the number only shows not the selected value.
How to solve this problem.Give solution for this.
Thanks in advance.
Nov 29 '07 #1
7 2518
CyberSoftHari
487 Expert 256MB
It is happening in refrech on postback.

Note : Give related topic for your post.
Nov 29 '07 #2
hi,
Thanks .how to refresh.wheather call load function in !postback
Nov 30 '07 #3
Shashi Sadasivan
1,435 Expert 1GB
Hi avanthika,
Welcome to TSDN

Please remember to provide a meaningful Title for any threads started (see the FAQ entry Use a Good Thread Title).

This helps to ensure that other members, and also the general public, will have a better chance of finding answers to any similar questions.

Please enclose your posted code in [code] tags (See How to Ask a Question).

This makes it easier for our Experts to read and understand it. Failing to do so creates extra work for the moderators, thus wasting resources, otherwise available to answer the members' questions.

Please use [code] tags in future.

- Shashi
Nov 30 '07 #4
Shashi Sadasivan
1,435 Expert 1GB
hello,

Expand|Select|Wrap|Line Numbers
  1.             vallist.DataSource = dt
  2.             vallist.DisplayMember = TextField
  3.             vallist.DataMember = IDField
  4.             vallist.ValueMember = IDField
  5.             vallist.DataBind()
from the above code, is vallist the combobox?
if so then as u can see the display memeber is selected to textField, and valuemember to IDField
If you want the user to view the IDField then assign IDField to the Displaymember

Secondly, The grid you are using is a third party tool..
if there any any queries regarding that, its better to ask their support as the chances of member os TSDN who have used the same will be low.
Nov 30 '07 #5
hi,
how to convert rupees into number format
Nov 30 '07 #6
Shashi Sadasivan
1,435 Expert 1GB
hi,
how to convert rupees into number format
Isint rupees already a number? (any currency is represented in numbers, i think thats how it works).

Is your currency input as a string?
which means that you want to remove the currency type, and convert the string to a numbner?

please follow up with input example so that we can help you better
Nov 30 '07 #7
Cell show incorrect value when Valuemember assigned as idfield
Nov 30 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Supa Hoopsa | last post by:
I have a databound combobox within a datagrid. I have set the DisplayMember and ValueMember. BUT, how do I capture the Value (SelectedValue) when the user changes the selection?
0
by: Ann Morris | last post by:
INTRODUCTION One of the most powerful aspects of .NET and Windows Forms is data binding. Data binding is the process of associating user interface (UI) elements with a data source to generate a...
10
by: BBFrost | last post by:
We just recently moved one of our major c# apps from VS Net 2002 to VS Net 2003. At first things were looking ok, now problems are starting to appear. So far ... (1) ...
7
by: charliewest | last post by:
Using .Net CF, i have created a 2 dimension ArrayList, and "binded" this list to a ComboBox control using the "DataSource" property. I have set the DisplaySource and ValueMember properties as well....
0
by: jac | last post by:
Hey, this.CmbDataSource = SoortKwijtingList.Items; // Arraylist this.Cmb.DisplayMember = "Omschrijving"; this.Cmb.ValueMember = "Id"; this.Cmb.SelectedIndex = -1; (short description : I...
0
by: Oz | last post by:
Hi Using VS.NET 2003, Windows XP SP1, We have a page which has been developed using ASP.NET. On it, is a button which when clicked is supposed to add some data to a table. When the button is...
6
by: Jenna Alten | last post by:
I have a datagrid with a template column that contains a dropdown list. I currently fill and display the dropdown list on the page load. This is working correctly. I am NOT using an Edit Column. I...
6
by: tfsmag | last post by:
I have a Grid that I've set up to have two of the fields use dropdownlists while in edit mode. Now I can bind the data to the dropdownlists just fine. My problem is that the second dropdown depends...
1
by: Shahzad Godil | last post by:
Hi, I am using WebCombo outside grid seperately in my FormView and not in grid. I am just going to replace my existing standard .net web controls with infragistics input controls Able to...
0
by: shamirza | last post by:
What is view state and use of it? The current property settings of an ASP.NET page and those of any ASP.NET server controls contained within the page. ASP.NET can detect when a form is requested...
0
by: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
How does React native implement an English player?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.