469,592 Members | 2,032 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,592 developers. It's quick & easy.

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

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 2264
487 Expert 256MB
It is happening in refrech on postback.

Note : Give related topic for your post.
Nov 29 '07 #2
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

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
how to convert rupees into number format
Nov 30 '07 #6
Shashi Sadasivan
1,435 Expert 1GB
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

Post your reply

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

Similar topics

8 posts views Thread by Supa Hoopsa | last post: by
6 posts views Thread by tfsmag | last post: by
1 post views Thread by Shahzad Godil | last post: by
reply views Thread by shamirza | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.