Hi,
i've made change in radgrid javascript events to overcome limitations of dealing with ID="data field name" and it works nice for initial load:
As you can see, i need more flexible way to manage fields. In your case, I cannot created 2 fields referencing the same datafield in the same ItemTemplate. Here I am having separate field sets for exporting into various formats. { } stands for Eval :)
I wonder why you have not used any custom attribute for WebControl, which would stand for DataField - you may add any - but instead sticked to ID and made serious usability limitations... :(
Anyway, now i have the problem with this: if I use ID="data field name" - sorting works as expected, but if I use my approach, without ID, correct data is returned from webmethod as before and dataSource is ok, but the grid is NOT sorted. Please, tell me what should i change in order it did sorting! :) I need it very much, but I don't have idea, where in the code you check for ID to use it somehow for sorting...
i've made change in radgrid javascript events to overcome limitations of dealing with ID="data field name" and it works nice for initial load:
<
asp:HyperLink
runat
=
"server"
Text
=
"{Name}"
bindfield
=
"Name,ID"
exportformats
=
"html"
OnPreRender
=
"hlName_PreRender"
/>
<
asp:Label
runat
=
"server"
Text
=
"{Name} for PDF"
exportformats
=
"pdf"
bindfield
=
"Name"
/>
<
asp:Label
runat
=
"server"
Text
=
"{Name} for Excel"
exportformats
=
"excel"
bindfield
=
"Name"
/>
I wonder why you have not used any custom attribute for WebControl, which would stand for DataField - you may add any - but instead sticked to ID and made serious usability limitations... :(
Anyway, now i have the problem with this: if I use ID="data field name" - sorting works as expected, but if I use my approach, without ID, correct data is returned from webmethod as before and dataSource is ok, but the grid is NOT sorted. Please, tell me what should i change in order it did sorting! :) I need it very much, but I don't have idea, where in the code you check for ID to use it somehow for sorting...