sort the grid

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sailucky
    New Member
    • Mar 2008
    • 1

    sort the grid

    hai friends helpme this is sailaja,

    i need to sort the datagrid, with respect to enter data in textbox which was placed out of grid
  • maheshmrk22
    New Member
    • Dec 2007
    • 23

    #2
    Hi,

    Are you using Datatable to store the added text? If that so then you can sort the datatable directly and then can bind it to datagrid. Or you can take your data in datatable and sort it and bind it to datagrid.

    Thanks
    Mahesh


    Originally posted by sailucky
    hai friends helpme this is sailaja,

    i need to sort the datagrid, with respect to enter data in textbox which was placed out of grid

    Comment

    • saran23
      New Member
      • Mar 2008
      • 28

      #3
      Originally posted by sailucky
      hai friends helpme this is sailaja,

      i need to sort the datagrid, with respect to enter data in textbox which was placed out of grid
      Hi Sailaja,

      May i know whether ur using datagrid(1.1) or gridview(2.0),
      If ur using grid view, then assign the datatable to DataView, use the sort property of dataview to sort the items based on the values, and then use this as a datasource for the grid view.
      But Im not sure whether Dataview is there in 1.1 version,
      If yes then U can use this.
      Here is a sample Code...

      Code:
        DataView dv = new DataView(datatable);
              dv.RowFilter = "columnname='" + urValue + "'";
              return dv;

      Comment

      Working...