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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • avanthika
    New Member
    • Nov 2007
    • 10

    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.

    [CODE=vbnet]Dim vallist As New Infragistics.We bUI.UltraWebGri d.ValueList
    Dim ds As New DataSet
    ds = _Utility.runsql ("select " + IDField + "," + TextField + " from " + TableName + " where Deleted=0")
    Dim dt As New DataTable
    dt.Columns.Add( "unit_id")
    dt.Columns.Add( "unit_name" )
    If ds.Tables(0).Ro ws.Count > 0 Then
    dt.Rows.Add("", "")
    End If
    For i As Integer = 0 To ds.Tables(0).Ro ws.Count - 1
    dt.Rows.Add(ds. Tables(0).Rows( i).Item(0).ToSt ring, ds.Tables(0).Ro ws(i).Item(1).T oString)
    Next
    vallist.DataSou rce = dt
    vallist.Display Member = TextField
    vallist.DataMem ber = IDField
    vallist.ValueMe mber = IDField
    vallist.DataBin d()
    Column.Type = Infragistics.We bUI.UltraWebGri d.ColumnType.Dr opDownList
    Column.ValueLis t = vallist[/CODE]
    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.
    Last edited by Shashi Sadasivan; Nov 30 '07, 04:48 AM. Reason: adding code tags
  • CyberSoftHari
    Recognized Expert Contributor
    • Sep 2007
    • 488

    #2
    It is happening in refrech on postback.

    Note : Give related topic for your post.

    Comment

    • avanthika
      New Member
      • Nov 2007
      • 10

      #3
      hi,
      Thanks .how to refresh.wheathe r call load function in !postback

      Comment

      • Shashi Sadasivan
        Recognized Expert Top Contributor
        • Aug 2007
        • 1435

        #4
        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

        Comment

        • Shashi Sadasivan
          Recognized Expert Top Contributor
          • Aug 2007
          • 1435

          #5
          hello,

          [CODE=vbnet] vallist.DataSou rce = dt
          vallist.Display Member = TextField
          vallist.DataMem ber = IDField
          vallist.ValueMe mber = IDField
          vallist.DataBin d()[/CODE]

          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.

          Comment

          • avanthika
            New Member
            • Nov 2007
            • 10

            #6
            convert rupees into number format

            hi,
            how to convert rupees into number format
            Last edited by avanthika; Nov 30 '07, 07:04 AM. Reason: for changing my title

            Comment

            • Shashi Sadasivan
              Recognized Expert Top Contributor
              • Aug 2007
              • 1435

              #7
              Originally posted by avanthika
              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

              Comment

              • avanthika
                New Member
                • Nov 2007
                • 10

                #8
                Cell show incorrect value when Valuemember assigned as idfield

                Comment

                Working...