8 Answers, 1 is accepted
How many items you have in these dropdowns? Do you use any ajax in your scenario?
Greetings,
Vlad
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Some dropdowns have around 200 items and some have 20-30. Therefore on average each drop down might have 50-60 items bound to it. Yes I am using Ajax.
Thanks a lot.
Milan G
Here are two ideas how to optimize your scenario:
1) Use RadComboBox with load on demand for these drop down columns in order to optimize rendered HTML size.
2) Get rid of the ViewState string. On every ajax request the ViewState is transfered between client and server and if you put for example this in Session you will get much faster response. You can check this post for more info how to do this:
http://blogs.telerik.com/vladimirenchev/posts/07-09-25/How_wrong_custom_ViewState_handling_may_harm_more_than_help.aspx
All the best,
Vlad
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
HI Vlad,
Thanks for the response.
Background -
Grid is populated with exception records from database - contains problematic records. User can rectify any values in the grid in Edit Mode. Thus requires me to populate most of the dropdownlist with valid items from other tables in database so user can make changes by selecting them.
a. Loading RadCombox is not possible - I am using GridDropDownColumn as a column wherever Drop down is required in edit mode.
b. As per your suggestion I have changed storing dataTable in viewstate to Session.
Unfortunately the performance is unacceptably slow.
Thanks,
Milan G
Following is a code snippet that gives what I am trying to achive.
<telerik:RadGrid ID="gridException" runat="server" Font-Names="Verdana" Font-Size="8pt"
ForeColor="SteelBlue" Skin="Web20" BorderWidth="0px" CellPadding="0" GridLines="None" AllowPaging="True" PageSize="100">
<ItemStyle Wrap="False" Font-Names="Verdana" Font-Size="8pt" />
<ClientSettings>
<Resizing AllowColumnResize="True" />
</ClientSettings>
<AlternatingItemStyle BackColor="AliceBlue" Font-Names="Verdana" Font-Size="8pt" Wrap="False" />
<MasterTableView AutoGenerateColumns="False" EditMode="InPlace" Width="100%" DataKeyNames="ExpenditureExceptionID">
<Columns>
<telerik:GridEditCommandColumn></telerik:GridEditCommandColumn>
<telerik:GridTemplateColumn UniqueName="TemplateColumn">
<ItemTemplate>
<asp:LinkButton ID="btnDelete" Text="Delete" CommandName="Delete" runat="server"></asp:LinkButton>
</ItemTemplate>
<HeaderStyle Width="50px" />
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn DataField="ExpenditureExceptionID" HeaderText="ExpenditureExceptionID" ReadOnly="True" Display="False" UniqueName="ExpenditureExceptionID"></telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="ExceptionNotes" HeaderText="Exp. Notes" UniqueName="ExceptionNotes" ReadOnly="True"></telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="SourceSystemID" HeaderText="Source System" UniqueName="SourceSystemID" ReadOnly="True" Display="False"></telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Items" HeaderText="Items" UniqueName="Items"></telerik:GridBoundColumn>
<telerik:GridDropDownColumn DataSourceID="SrcForBusiness" DataField="Business" ListTextField="BusinessName" ListValueField="BusinessName" HeaderText="Business" UniqueName="Business"></telerik:GridDropDownColumn>
<telerik:GridDropDownColumn DataSourceID="SrcForBrand" DataField="Brand" ListTextField="BrandName" ListValueField="BrandName" HeaderText="Brand" UniqueName="Brand"></telerik:GridDropDownColumn>
<telerik:GridDropDownColumn DataSourceID="SrcForMediaType" DataField="MediaType" ListTextField="MediaName" ListValueField="MediaName" HeaderText="Media Type" UniqueName="MediaType"></telerik:GridDropDownColumn>
<telerik:GridBoundColumn DataField="ConsumerActivityDesc" HeaderText="ConsumerActivityDesc" UniqueName="ConsumerActivityDesc"></telerik:GridBoundColumn>
<telerik:GridDropDownColumn DataSourceID="SrcForVendor" DataField="VendorName" ListTextField="VendorName" ListValueField="VendorName" HeaderText="Vendor" UniqueName="VendorName"></telerik:GridDropDownColumn>
<telerik:GridDropDownColumn DataSourceID="SrcForSupplier" DataField="SupplierName" ListTextField="SupplierName" ListValueField="SupplierName" HeaderText="Supplier" UniqueName="SupplierName"></telerik:GridDropDownColumn>
<telerik:GridBoundColumn DataField="GlobePONumber" HeaderText="Globe PO Number" UniqueName="GlobePONumber"></telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="GoodsReceivedDate" HeaderText="Goods Received Date" UniqueName="GoodsReceivedDate"></telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Currency" HeaderText="Currency" UniqueName="Currency" ReadOnly="true"></telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="GRCosts" HeaderText="GR Costs" UniqueName="GRCosts"></telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="NetCost" HeaderText="Net Cost" UniqueName="NetCost"></telerik:GridBoundColumn>
</Columns>
<EditFormSettings>
<EditColumn UniqueName="EditCommandColumn1">
</EditColumn>
</EditFormSettings>
<RowIndicatorColumn>
<HeaderStyle Width="20px" />
</RowIndicatorColumn>
<ExpandCollapseColumn>
<HeaderStyle Width="20px" />
</ExpandCollapseColumn>
</MasterTableView>
<FilterMenu EnableTheming="True" Skin="Web20">
<CollapseAnimation Duration="200" Type="OutQuint" />
</FilterMenu>
<PagerStyle Mode="NextPrevAndNumeric" Position="TopAndBottom" />
</telerik:RadGrid><br />
<asp:Button ID="btnSubmitBatch" runat="server" CssClass="buttonFont" Text="Submit Batch" /> <asp:Button
ID="btnDeleteBatch" runat="server" CssClass="buttonFont" Text="Discard Batch" /><br />
<asp:ObjectDataSource ID="SrcForBusiness" runat="server" SelectMethod="GetAllBusinessName"
TypeName="ProjectTemplar.BusinessPillarManager"></asp:ObjectDataSource>
<asp:ObjectDataSource ID="SrcForBrand" runat="server" SelectMethod="GetAllBrandName"
TypeName="ProjectTemplar.BrandManager"></asp:ObjectDataSource>
<asp:ObjectDataSource ID="SrcForVendor" runat="server" SelectMethod="GetAllVendor" TypeName="ProjectTemplar.VendorManager"></asp:ObjectDataSource>
<asp:ObjectDataSource ID="SrcForSupplier" runat="server" SelectMethod="GetAllSupplier"
TypeName="ProjectTemplar.SupplierManager"></asp:ObjectDataSource>
<asp:ObjectDataSource ID="SrcForMediaType" runat="server" SelectMethod="GetAllMedia"
TypeName="ProjectTemplar.MediaManager"></asp:ObjectDataSource>
</
asp:Content>
.....
And the corresponding page behind code...
Private
ReadOnly Property GridSource() As DataTable
'Storing dataTable in session rather than in ViewState
Get
'Dim obj As Object = Me.ViewState("_gds")
'If (Not obj Is Nothing) Then
'Return CType(obj, DataTable)
Dim obj As Object = Session.Item("dTable")
If (Not obj Is Nothing) Then
Return CType(obj, DataTable)
Else
Dim table As DataTable = Nothing
Try
Dim ds As DataSet = Nothing
Dim manager As New ExpenditureDataManager()
ds = manager.GetExpenditureExceptionsByBatchIDForMediaAgency(m_batchID)
table = ds.Tables(0)
'Me.ViewState("_gds") = table
Session.Add("dTable", table)
Return table
Catch ex As Exception
lblErrorMsg.Text = ex.Message
End Try
Return table
End If
End Get
End Property
Protected Sub gridException_NeedDataSource(ByVal source As System.Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles gridException.NeedDataSource
If Me.GridSource.Rows.Count = 0 Then
Response.Redirect("ImportStatus.aspx")
End If
gridException.DataSource = Me.GridSource
End Sub
I highly recommend you to consider using a LoadOnDemand feature of RadComboBox control. I have attached a sample page which demonstrates a vary simple implementation of how to set a GridDropDownColumn to use a LoadOnDemand feature of RadComboBox.
Please give it a try and let us know if this helps.
Best wishes,
Rosen
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Thanks for the code - I got the problem @ editor.ComboBoxControl.ItemsRequested += ComboBoxControl_ItemsRequested;
ItemsRequested is not recognised. By the way is it possible to equivalent vb.net code. I code convertor but not that impressive.
Thanks a lot.
Regards,
Milan G
Please find attached the same sample page translated to vb. Let us know if this helps.
Best wishes,
Rosen
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Many thanks for the code - will update you the status.
Cheers,
Milan G