I have never used Infrigistics controls before. I inherited a web page that uses the UltraWebGrid control. It is very slow at this point and I was hoping some of you can help me speed things up. Here is my aspx code:
<igtbl:UltraWebGrid ID="UltragridPres" runat="server" Width="1500px"> <Bands> <igtbl:UltraGridBand> <AddNewRow View="NotSet" Visible="NotSet"> </AddNewRow> </igtbl:UltraGridBand> </Bands> <DisplayLayout AllowColSizingDefault="Free" AllowDeleteDefault="Yes" ScrollBarView="Vertical" AllowUpdateDefault="Yes" BorderCollapseDefault="Separate" Name="UltraWebGrid1" RowHeightDefault="20px" SelectTypeRowDefault="Single" TableLayout="Fixed" Version="4.00" AllowAddNewDefault="Yes" SelectTypeCellDefault="Single" CellClickActionDefault="RowSelect" CompactRendering="False" StationaryMargins="Header" ColHeadersVisibleDefault="Yes"> <FrameStyle BackColor="Window" BorderColor="InactiveCaption" Font-Names="Microsoft Sans Serif" Font-Size="8.25pt" Width="1500px" Height="200px"> </FrameStyle> <Pager MinimumPagesForDisplay="2"> <PagerStyle BackColor="LightGray" BorderStyle="Solid" BorderWidth="1px"> <BorderDetails ColorLeft="White" ColorTop="White" WidthLeft="1px" WidthTop="1px" /> </PagerStyle> </Pager> <EditCellStyleDefault BorderStyle="None" BorderWidth="0px"> </EditCellStyleDefault> <FooterStyleDefault BackColor="LightGray" BorderStyle="Solid" BorderWidth="1px"> <BorderDetails ColorLeft="White" ColorTop="White" WidthLeft="1px" WidthTop="1px" /> </FooterStyleDefault> <ClientSideEvents InitializeRowHandler="UltragridPres_InitializeRow" AfterCellUpdateHandler="UltragridPres_AfterCellUpdateHandler" CellClickHandler="UltragridPres_Click" AfterRowActivateHandler="AfterRowActivateHandler" MouseOverHandler="MouseOver" MouseOutHandler="MouseOut" /> <HeaderStyleDefault Height="25px" BackColor="#006699" BorderWidth="1px" BorderStyle="Solid" VerticalAlign="Middle" HorizontalAlign="Left" Font-Bold="true" ForeColor="White"> <BorderDetails ColorLeft="#006699" ColorTop="White" WidthLeft="1px" ColorBottom="Gray" WidthTop="1px" ColorRight="Gray" /> </HeaderStyleDefault> <RowSelectorStyleDefault BorderColor="#006699"> <BorderDetails StyleBottom="None" StyleLeft="None" StyleRight="None" StyleTop="Solid" /> </RowSelectorStyleDefault> <RowStyleDefault BorderColor="Silver" BorderStyle="Solid" BorderWidth="1px" Font-Names="Microsoft Sans Serif" Font-Size="8.25pt" Cursor="hand"> <Padding Left="3px" /> <BorderDetails ColorLeft="Window" ColorTop="Window" /> </RowStyleDefault> <RowAlternateStyleDefault CssClass="gridAlternateItem"> </RowAlternateStyleDefault> <SelectedRowStyleDefault CssClass="girdSelectedItem" Cursor="hand"> </SelectedRowStyleDefault> <ActivationObject BorderColor="" BorderWidth=""> </ActivationObject> </DisplayLayout> </igtbl:UltraWebGrid>
Here is the C# code that loads the grid:
UltragridPres.Columns[0].Hidden = true; UltragridPres.Columns[1].Hidden = true; UltragridPres.Columns[0].Width = Unit.Pixel(0); UltragridPres.Columns[0].DefaultValue = 0; UltragridPres.Columns[1].Width = Unit.Pixel(0);
UltragridPres.Columns[2].Header.Caption = "Medication"; UltragridPres.Columns[3].Header.Caption = "Strength"; UltragridPres.Columns[4].Header.Caption = "Unit"; UltragridPres.Columns[5].Header.Caption = "Dosage"; UltragridPres.Columns[6].Header.Caption = "Route"; UltragridPres.Columns[7].Header.Caption = "Direction"; UltragridPres.Columns[8].Header.Caption = "Dispense - Qualifier"; UltragridPres.Columns[9].Header.Caption = "Duration"; UltragridPres.Columns[10].Header.Caption = "Refill"; UltragridPres.Columns[11].Header.Caption = "PRN"; UltragridPres.Columns[12].Header.Caption = "Start Date"; UltragridPres.Columns[13].Header.Caption = "End Date";
//CSACode UltragridPres.Columns[43].Width = Unit.Pixel(0); UltragridPres.Columns[43].Hidden = true;
#endregion
for (int countColumns = 0; countColumns < UltragridPres.Columns.Count; countColumns++) { UltragridPres.Columns[countColumns].CellStyle.Wrap = false; UltragridPres.Columns[countColumns].Header.Style.HorizontalAlign = HorizontalAlign.Center; if ((countColumns >= 14 && countColumns <= 33) || countColumns == 42) { UltragridPres.Columns[countColumns].Hidden = true; UltragridPres.Columns[countColumns].Width = Unit.Pixel(0); } }
string deleteHeaderText = string.Empty;
deleteHeaderText = "<input type=\"checkbox\" id=\"chkDeleteAll\"" + " onclick=\"checkAll(this,0);\" class=\"sCheckBox\" align=\"left\" />"; deleteHeaderText += "<input type=button id=\"btnDelete\" value=\"Delete\"" + " class=\"classButton\" style=\"width:50px;height:20px;\" onclick=\"checkDeleteItems();\" />";
UltragridPres.Columns[34].Header.Caption = "Approve"; UltragridPres.Columns[35].Header.Caption = "Deny"; UltragridPres.Columns[36].Header.Caption = "Send On"; UltragridPres.Columns[37].Header.Caption = "Service Level";
string sendHeader = string.Empty; //34 th col(33th index) if (pageId == 1 && typeId == 0) { sendHeader = "<input type=\"checkbox\" id=\"chkSendAll\" " + "onclick=\"checkAllSendCheckbox(this);\" class=\"sCheckBox\" align=\"left\" />" + "<input type=button id=\"btnSend\" value=\"Send\" class=\"classButton\"" + " style=\"width:50px;height:20px;\" />"; } else { sendHeader = "<input type=\"checkbox\" id=\"chkSendAll\" " + "onclick=\"checkAllSendCheckbox(this);\" class=\"sCheckBox\" align=\"left\" />" + "<input type=button id=\"btnSend\" value=\"Send\" class=\"classButton\"" + " style=\"width:50px;height:20px;\" onclick=\"SelectSendRecords();\" />"; }
UltragridPres.Columns[39].Header.Caption = sendHeader;
string printHeader = "<input type=\"checkbox\" id=\"chkPrintAll\" " + "onclick=\"checkAllPrintCheckbox(this);\" class=\"sCheckBox\" align=\"left\" />" + "<input type=button id=\"btnPrint\" value=\"Print\" class=\"classButton\" " + "style=\"width:50px;height:20px;\" onclick=\"SelectPrintRecords();\" />";
UltragridPres.Columns[40].Header.Caption = printHeader; UltragridPres.Columns[41].Header.Caption = deleteHeaderText;
//add button in phy management prescription or Prescription inside encounter or clinical add prescription if (pageId == 2 && typeId == 0 || pageId == 1 && typeId == 0 || pageId == 0 && typeId == 0) { //UltragridPres.Columns[40].Hidden = true; // UltragridPres.Columns[40].Width = Unit.Pixel(0);
UltragridPres.Columns[2].Width = Unit.Percentage(7); UltragridPres.Columns[3].Width = Unit.Percentage(5); UltragridPres.Columns[4].Width = Unit.Percentage(3); UltragridPres.Columns[5].Width = Unit.Percentage(5); UltragridPres.Columns[6].Width = Unit.Percentage(4); UltragridPres.Columns[7].Width = Unit.Percentage(6); UltragridPres.Columns[8].Width = Unit.Percentage(8); UltragridPres.Columns[9].Width = Unit.Percentage(6); UltragridPres.Columns[10].Width = Unit.Percentage(4); UltragridPres.Columns[11].Width = Unit.Percentage(4); UltragridPres.Columns[12].Width = Unit.Percentage(5); UltragridPres.Columns[13].Width = Unit.Percentage(6); //61
UltragridPres.Columns[36].Width = Unit.Percentage(4); UltragridPres.Columns[37].Width = Unit.Percentage(6); UltragridPres.Columns[38].Width = Unit.Percentage(8); UltragridPres.Columns[39].Width = Unit.Percentage(5);
UltragridPres.Columns[41].Width = Unit.Percentage(5); //32
if (hidCheckPrn.Value == "1") //if e-sending feature available then set the col width as below { if (pageId == 0) //physician { UltragridPres.Columns[34].Width = Unit.Percentage(3); UltragridPres.Columns[35].Width = Unit.Percentage(3); UltragridPres.Columns[40].Width = Unit.Percentage(5); UltragridPres.Columns[2].Width = Unit.Percentage(6); UltragridPres.Columns[38].Width = Unit.Percentage(6); UltragridPres.Columns[39].Width = Unit.Percentage(6); UltragridPres.Columns[41].Width = Unit.Percentage(6); //32 btnSaveClose.Visible = true; } else { if (pageId == 2) //Prescription inside encounter { UltragridPres.Columns[40].Hidden = false; UltragridPres.Columns[40].Width = Unit.Percentage(5); UltragridPres.Columns[2].Width = Unit.Percentage(9); } else //clinical { UltragridPres.Columns[2].Width = Unit.Percentage(8); UltragridPres.Columns[40].Width = Unit.Percentage(5); UltragridPres.Columns[38].Width = Unit.Percentage(9); } UltragridPres.Columns[34].Hidden = true; UltragridPres.Columns[34].Width = Unit.Pixel(0); UltragridPres.Columns[35].Hidden = true; UltragridPres.Columns[35].Width = Unit.Pixel(0); } } else { PrnInvisible(); //make invisible as prn UltragridPres.Columns[36].Hidden = true; UltragridPres.Columns[36].Width = Unit.Pixel(0); UltragridPres.Columns[37].Hidden = true; UltragridPres.Columns[37].Width = Unit.Pixel(0); UltragridPres.Columns[38].Hidden = true; UltragridPres.Columns[38].Width = Unit.Pixel(0); UltragridPres.Columns[39].Hidden = true; UltragridPres.Columns[39].Width = Unit.Pixel(0); UltragridPres.Columns[11].Hidden = true; UltragridPres.Columns[11].Width = Unit.Pixel(0);
if (pageId == 0) //physician { UltragridPres.Columns[2].Width = Unit.Percentage(19); UltragridPres.Columns[8].Width = Unit.Percentage(10); UltragridPres.Columns[34].Width = Unit.Percentage(4); UltragridPres.Columns[35].Width = Unit.Percentage(3); UltragridPres.Columns[40].Width = Unit.Percentage(7); btnSaveClose.Visible = true; } else { if (pageId == 2) //Prescription inside encounter { UltragridPres.Columns[2].Width = Unit.Percentage(32); UltragridPres.Columns[8].Width = Unit.Percentage(10);
UltragridPres.Columns[40].Width = Unit.Percentage(7); } else //clincal { UltragridPres.Columns[2].Width = Unit.Percentage(24); UltragridPres.Columns[8].Width = Unit.Percentage(12); UltragridPres.Columns[3].Width = Unit.Percentage(8); UltragridPres.Columns[40].Width = Unit.Percentage(7); }
UltragridPres.Columns[34].Hidden = true; UltragridPres.Columns[34].Width = Unit.Pixel(0); UltragridPres.Columns[35].Hidden = true; UltragridPres.Columns[35].Width = Unit.Pixel(0); } } } else //for EDIt prescription in physician and clinical prescription (complete stage) { UltragridPres.Columns[34].Width = Unit.Percentage(4); UltragridPres.Columns[35].Width = Unit.Percentage(4); //100
if (hidCheckPrn.Value != "1") //if esending available { UltragridPres.Columns[11].Hidden = true; UltragridPres.Columns[11].Width = Unit.Pixel(0); UltragridPres.Columns[2].Width = Unit.Percentage(12); UltragridPres.Columns[3].Width = Unit.Percentage(6); UltragridPres.Columns[4].Width = Unit.Percentage(5); UltragridPres.Columns[5].Width = Unit.Percentage(6); UltragridPres.Columns[6].Width = Unit.Percentage(6); UltragridPres.Columns[7].Width = Unit.Percentage(8); UltragridPres.Columns[8].Width = Unit.Percentage(8); //50 UltragridPres.Columns[9].Width = Unit.Percentage(8); UltragridPres.Columns[10].Width = Unit.Percentage(6); UltragridPres.Columns[12].Width = Unit.Percentage(7); UltragridPres.Columns[13].Width = Unit.Percentage(8); //85 UltragridPres.Columns[41].Width = Unit.Percentage(7); UltragridPres.Columns[40].Width = Unit.Percentage(5); UltragridPres.Columns[36].Hidden = true; UltragridPres.Columns[36].Width = Unit.Pixel(0); UltragridPres.Columns[37].Hidden = true; UltragridPres.Columns[37].Width = Unit.Pixel(0); UltragridPres.Columns[38].Hidden = true; UltragridPres.Columns[38].Width = Unit.Pixel(0); UltragridPres.Columns[39].Hidden = true; UltragridPres.Columns[39].Width = Unit.Pixel(0); PrnInvisible(); } else { UltragridPres.Columns[2].Width = Unit.Percentage(7); UltragridPres.Columns[3].Width = Unit.Percentage(5); UltragridPres.Columns[4].Width = Unit.Percentage(3); UltragridPres.Columns[5].Width = Unit.Percentage(5); UltragridPres.Columns[6].Width = Unit.Percentage(4); UltragridPres.Columns[7].Width = Unit.Percentage(6); UltragridPres.Columns[8].Width = Unit.Percentage(5); UltragridPres.Columns[9].Width = Unit.Percentage(5); UltragridPres.Columns[10].Width = Unit.Percentage(3); UltragridPres.Columns[11].Width = Unit.Percentage(3); UltragridPres.Columns[12].Width = Unit.Percentage(5); UltragridPres.Columns[13].Width = Unit.Percentage(5); UltragridPres.Columns[41].Width = Unit.Percentage(6); //69 UltragridPres.Columns[36].Width = Unit.Percentage(4); UltragridPres.Columns[37].Width = Unit.Percentage(6); UltragridPres.Columns[38].Width = Unit.Percentage(8); UltragridPres.Columns[39].Width = Unit.Percentage(6); UltragridPres.Columns[40].Width = Unit.Percentage(6); }
if (typeId == Managements.PHYSICIANPRESCIPTION) //clinical { UltragridPres.Columns[34].AllowUpdate = AllowUpdate.No; UltragridPres.Columns[35].AllowUpdate = AllowUpdate.No; UltragridPres.Columns[41].AllowUpdate = AllowUpdate.No; UltragridPres.Bands[0].CellClickAction = CellClickAction.CellSelect; } else { btnSaveClose.Visible = true; } } }
Like I said, I have never used these controls. Presently, it takes about 90 seconds to load the grid. Is there anything I can do to speed up loading this grid?
Hello Herrmann,
Thank you to contact us.
I want to clarify that version 11.1 of our ASP.NET Controls is retired and no longer supported, and you can take at our Product Lifecycle - http://ko.infragistics.com/support/product-lifecycle.
Your markup is good and this delay can depends from many criteria, for example from the data that you load, from the server where you get your current data.