I have a radgrid exposing a table with many records in it, in the tens of thousands.
I tried to implement filtering on this grid but I could not get it to work without pulling down enormous ajax responses (around 6 megs). I tried to figure out why the grid was, I'm guessing, trying to do all the filtering on the client side. I followed instructions on doing filtering server side, calling a server method and setting the filterExpression property on the server to handle the filtering but for whatever reason, the grid would not filter without pulling down these multi megabyte ajax responses.
Stumped, I instead wrote my own custom filtering functionality, using the Where field of the LinqDataSource I have connected to the radgrid. This worked wonderfully, nice and lean it would filter the grid. It worked wonderfully, that is, until I discovered editing wasn't working with my LinqDataSource's Where field manipulation. Specifically, hitting the GridEditCommandColumn on the grid wasn't pulling up the correct grid item.
Investigating the OnEditCommand event of my grid, I discovered the Where field of my LinqDataSource was coming up blank after I had set it dynamically in my filter method. The Where parameter I set was there, but not Where string ("Id == @Id" OR whatever). I also realized eventually that neither sorting or paging were working with the filtration either. The Where property wasn't keeping.
Does this sound like a viewstate problem? I have enabled viewstate on the LinqDataSource but I imagine it was probably that way by default, and still the Where property doesn't keep.
I wrote a workaround that saves the Where field string in a page member and in the OnEdit-Sort-PageCommand event checks to see if a Where parameter is on the LinqDataSource, and if it is puts the Where property value back. It's hacky though and it seems as though I'm missing something.
Seth
I tried to implement filtering on this grid but I could not get it to work without pulling down enormous ajax responses (around 6 megs). I tried to figure out why the grid was, I'm guessing, trying to do all the filtering on the client side. I followed instructions on doing filtering server side, calling a server method and setting the filterExpression property on the server to handle the filtering but for whatever reason, the grid would not filter without pulling down these multi megabyte ajax responses.
Stumped, I instead wrote my own custom filtering functionality, using the Where field of the LinqDataSource I have connected to the radgrid. This worked wonderfully, nice and lean it would filter the grid. It worked wonderfully, that is, until I discovered editing wasn't working with my LinqDataSource's Where field manipulation. Specifically, hitting the GridEditCommandColumn on the grid wasn't pulling up the correct grid item.
Investigating the OnEditCommand event of my grid, I discovered the Where field of my LinqDataSource was coming up blank after I had set it dynamically in my filter method. The Where parameter I set was there, but not Where string ("Id == @Id" OR whatever). I also realized eventually that neither sorting or paging were working with the filtration either. The Where property wasn't keeping.
Does this sound like a viewstate problem? I have enabled viewstate on the LinqDataSource but I imagine it was probably that way by default, and still the Where property doesn't keep.
I wrote a workaround that saves the Where field string in a page member and in the OnEdit-Sort-PageCommand event checks to see if a Where parameter is on the LinqDataSource, and if it is puts the Where property value back. It's hacky though and it seems as though I'm missing something.
Seth