Posted 2/20/2007 7:59:44 AM | | | | Hi, I'm using the Grid control to display entities from CRm but that get the data using SQL. Everything's fine when it first loads and I've got paging and sorting working. The problem is that I want to use the search and view selectors to filter results so I'd have Grid1.SearchingStyle = SearchingStyles.Standard; Grid1.ViewsSelectorStyle = ViewsSelectorStyles.Standard; but when I hit Find or select a filter the grid shows the columns for a saved view from CRM. I want it to keep the columns I specified in the AreaPage with the grid on. I can get the columns for my grid from the layoutxml of a view but I want to add to them and then have them stay the same. How can I disable the update of the columns in the grid? |
| Posted 2/20/2007 9:41:11 AM | | | Digiterre (2/20/2007)
How can I disable the update of the columns in the grid?
Only thing I can think of is doing:
objGrid.SearchingStyle = SearchingStyles.None;
objGrid.ViewsSelectorStyle = ViewsSelectorStyles.None
And then implement an input box to search and a viewselector yourself...
Setting the ViewSelector to something other then None will cause the grid to always set the columns based on the selected view.
Maybe using gridpreferences (as in the sample) might give you more control but have not tried that (but I believe in the sample the above props are also set to ...None...) |
| Posted 2/21/2007 6:03:01 AM | | | | Oh. That seems a bit presumptuous to not have the option and rather diminishes the Grid's usefullness. I could just redirect to the CRM view if I wanted that. But Ok. If I implement my own filter and search controls, how do I get the grid to post pack asynchronously to get the xml data again, passing my filter criteria back to the GridDataPage? See how this would be easier if I could just tell it not to change the view? |
| Posted 2/21/2007 9:55:26 AM | | | Digiterre (2/21/2007) Oh. That seems a bit presumptuous to not have the option and rather diminishes the Grid's usefullness. I could just redirect to the CRM view if I wanted that.
I am not sure if the actually can not be done...I simply do not if there is an easier way...
Digiterre (2/21/2007)
But Ok. If I implement my own filter and search controls, how do I get the grid to post pack asynchronously to get the xml data again, passing my filter criteria back to the GridDataPage?
Take a look at the sample in the link below:
http://www.c360.com/Forums/Topic1187-39-1.aspx
One thing you could do is use the sFilterValue_GridId variable that is added by c360 to pass values to the GridDataPage.
(GridId is the value of the ID property of the IGrid in the .NET code...)
1) You add the following to your page
- an input box
- a search button
- picklist with the available views
2) create a client javascript method for the search button
3) in that method
populate the sFilterValue_GridId with a "packed" combination of:
- the value in the input box (use the javascript DOM...)
- the selected view (use the javascript DOM)
4) add a call to that method to refresh the grid.
- RefreshGrid_GridId();
(GridId is the value of the ID property of the IGrid in the .NET code...)
5) in your GridDataPage "unpack" the values you added in javascript from the FilterValue property and use it to fetch the data your return using a XmlResultSet
Is this something you could use?
Digiterre (2/21/2007)See how this would be easier if I could just tell it not to change the view?
Yup. I agree with you. I definitely would vote for an option to override the columns when using the ViewSelector, but I guess that would break the use of views and the way you can design them using CRM itself...but then again... |
| Posted 2/22/2007 6:40:30 PM | | | Oh. That seems a bit presumptuous to not have the option and rather diminishes the Grid's usefullness. I could just redirect to the CRM view if I wanted that. Our grid was designed to mimic the Microsoft CRM grid which explains why it is updated when the user selects a different view. I understand that you would like it to behave differently and I am sorry that you feel that this behavior diminishes the usefullness of our control. Your feedback is noted and we may consider changing our control's behavior if enough users request it.
|
| |
|