Hi there,
I have a question about radGrid clien-side databinding, using WebServices.
In my RadGrid, I'm grouping datas function of a column. When I update dynamically(client-side) my datagrid, grouping doesn't seem to work well:
independently of the number of elements which belong to the group, this one have always have the same number of items.
Here, I'm grouping fonction of MembreConvers wich is a string.
And I'm updating it with that javascript, client-side. I need to pass args to my WebMethod, so I'm not using Telerik's codeLess method.
WebService returns List<Contact>:
On page load, server-side, in "RadGridContacts_NeedDataSource" method I create MasterTableView like that:
Is there an easy trick to update these groups client-side?
Thanks a lot,
Alex.
I have a question about radGrid clien-side databinding, using WebServices.
In my RadGrid, I'm grouping datas function of a column. When I update dynamically(client-side) my datagrid, grouping doesn't seem to work well:
independently of the number of elements which belong to the group, this one have always have the same number of items.
Here, I'm grouping fonction of MembreConvers wich is a string.
| <MasterTableView ClientDataKeyNames="IdContact" GroupLoadMode="Client" | |
| NoMasterRecordsText="" ShowHeadersWhenNoRecords="true" Width="100%"> | |
| <GroupByExpressions> | |
| <telerik:GridGroupByExpression> | |
| <SelectFields> | |
| <telerik:GridGroupByField FieldAlias="MembreConvers" FieldName="MembreConvers" | |
| HeaderText="Participe" /> | |
| </SelectFields> | |
| <GroupByFields> | |
| <telerik:GridGroupByField FieldName="MembreConvers" /> | |
| </GroupByFields> | |
| </telerik:GridGroupByExpression> | |
| </GroupByExpressions> | |
| <Columns> | |
| <telerik:GridMaskedColumn DataField="MembreConvers" | |
| SortExpression="MembreConvers"> | |
| </telerik:GridMaskedColumn> | |
| <!-- Continue --> |
And I'm updating it with that javascript, client-side. I need to pass args to my WebMethod, so I'm not using Telerik's codeLess method.
| //Called When WebService GetContactListForConversation return | |
| function SucceededCallbackGetParticipants(result, eventArgs) { | |
| //Conversation ID - and so window - is in eventArgs. | |
| //It allows us to get current conversation's radWindow | |
| var radWindowManager = GetRadWindowManager(); | |
| var window_ = radWindowManager.getWindowById(eventArgs); | |
| if (window_ != null) { | |
| //Get the frame | |
| var frame = window_.get_contentFrame(); | |
| //Get the window | |
| var windowContent_ = frame.contentWindow; | |
| var radGrid = windowContent_.$find("RadGridContacts"); | |
| //Get Master TableView | |
| var tableView = radGrid.get_masterTableView(); | |
| //Set dataSource and DataBind | |
| tableView.set_dataSource(result); | |
| tableView.dataBind(); | |
| //Using setTimeout instead of setInterval(firefox compatible) | |
| setTimeout(function() { GetParticipantsForConversation(eventArgs) }, timeout); | |
| } |
WebService returns List<Contact>:
| public class Contact | |
| { | |
| public string NomPrenom { get; set; } | |
| public int IdContact { get; set; } | |
| public string EnLigne { get; set; } | |
| public string MembreConvers { get; set; } | |
| // Continue here .... | |
| } |
| //Test | |
| List<Contact> contactsList = new List<Contact>(); | |
| //there will be 2 groups : "Oui" and "Non". | |
| contactsList.Add(new Contact("", 0, true, "Oui")); | |
| contactsList.Add(new Contact("", 0, true, "Non")); RadGridContacts.MasterTableView.DataSource = contactsList; | |
| /*And when I'm updating Client-side, group "Oui" and "Non" are limited to 1 item each. How can I fill them client-side?*/ |
Thanks a lot,
Alex.