This is a migrated thread and some comments may be shown as answers.

is this a bug? about index of the gridview after it is resorted

1 Answer 24 Views
GridView
This is a migrated thread and some comments may be shown as answers.
li
Top achievements
Rank 1
li asked on 14 Feb 2017, 06:33 PM

hi

i am trying to develop with telerik,and i find this issue

example

there is some data in the gridview like 

id   name   birthday

1    lee    1984-01-01

2    chiang  2000-05-03

3    tom    1986-03-03

      jim    1996-12-01

i resort by name column then i get the table below

id   name   birthday
2    chiang  2000-05-03
      jim    1996-12-01
1    lee    1984-01-01
3    tom    1986-03-03

int index = -1;

 

 

foreach(gridviewrowinfo row in rows)

{

  if(row.cells["name"]=="lee")

    {index=row.index;}  //here we can get the index = 2

}

if(index>-1)

{

  rows[index].cells["birthday"]="1999-03-05";

}

then we get the table below:

id   name   birthday
2    chiang  2000-05-03
      jim    1996-12-01
1    lee    1984-01-01
3    tom    1999-03-05

 

have anyone get the mind that i mean?

when after the foreach we get a index after resorted and when we use rows[index] then the gridview point to the line before it is resorted!

so does it a bug?when will you fix it?

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 17 Feb 2017, 01:33 PM
Hello Li Zhibin,

The UI for WPF RadGridView does not expose a GridViewRowInfo object. May I ask you to verify that you are posting in the correct product section, as I assume that you are using the UI for WinForms RadGridView instead? If this is the case, I would kindly ask you to post your question in the relevant product section.

Thank you in advance for your cooperation.

Regards,
Stefan X1
Telerik by Progress
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
GridView
Asked by
li
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or