473,394 Members | 1,797 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 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 2551
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.