I have a radgrid that is created dynamically. But when i click on the rows in the grid.The grid is shaking and the column seem to adjust.
Any help on this would be greatly appreciated.
Below is the code for the radgrid
RadGrid
grid = new RadGrid();
grid.ID =
"radGridProducts";
grid.AutoGenerateColumns =
false;
grid.AllowSorting =
true;
grid.AllowMultiRowSelection =
true;
grid.AllowMultiRowEdit =
true;
grid.GridLines =
GridLines.None ;
//grid.Width = Unit.Percentage(100);
//grid.MasterTableView.TableLayout = GridTableLayout.Fixed;
grid.Height =
Unit.Pixel(380);
String htmlColor = "#EDEFF1";
Color backColor = ColorTranslator.FromHtml(htmlColor);
grid.AlternatingItemStyle.BackColor = backColor;
//grid.BorderColor = Color.Blue;
grid.MasterTableView.AllowPaging =
true;
grid.MasterTableView.PagerStyle.AlwaysVisible =
true;
grid.MasterTableView.PagerStyle.Position =
GridPagerPosition.TopAndBottom;
grid.MasterTableView.PagerStyle.Mode =
GridPagerMode.NextPrevNumericAndAdvanced;
grid.ClientSettings.AllowKeyboardNavigation =
true;
grid.ClientSettings.Selecting.AllowRowSelect=
true;
grid.ClientSettings.Scrolling.AllowScroll =
true;
grid.ClientSettings.Scrolling.UseStaticHeaders =
true;
grid.ClientSettings.Scrolling.ScrollHeight =
Unit.Pixel(300);
grid.FilterMenu.EnableTheming=
true;
grid.FilterMenu.CollapseAnimation.Duration = 200;
grid.FilterMenu.CollapseAnimation.Type =
AnimationType.OutQuint;
//Add Products Master table
grid.MasterTableView.Name =
"ProductParent";
grid.MasterTableView.PageSize = 30;
grid.MasterTableView.DataKeyNames =
new string[] { "Id", "ParentId","ProductLevel","Tag"};
grid.MasterTableView.EditMode =
GridEditMode.InPlace;
//grid.MasterTableView.TableLayout = GridTableLayout.Fixed;
GridEditCommandColumn col0 = new GridEditCommandColumn();
col0.ButtonType =
GridButtonColumnType.ImageButton;
col0.UpdateImageUrl =
"../images/Update.gif";
col0.EditImageUrl =
"../images/Edit.gif";
col0.InsertImageUrl =
"../images/Insert.gif";
col0.CancelImageUrl =
"../images/Cancel.gif";
col0.UniqueName =
"EditCommandColumn";
grid.MasterTableView.Columns.Add(col0);
//grid.MasterTableView.Columns[0].HeaderStyle.Width = Unit.Percentage(4);
//grid.MasterTableView.Columns[0].HeaderStyle.Width = Unit.Pixel(30);
GridButtonColumn col1 = new GridButtonColumn();
col1.Text =
"Delete";
col1.ConfirmText =
"Delete this product?";
col1.ButtonType =
GridButtonColumnType.ImageButton;
col1.ImageUrl =
"../images/Delete.gif";
col1.CommandName =
"Delete";
col1.UniqueName =
"DeleteColumn";
grid.MasterTableView.Columns.Add(col1);
//grid.MasterTableView.Columns[1].HeaderStyle.Width = Unit.Percentage(3);
//grid.MasterTableView.Columns[1].HeaderStyle.Width = Unit.Pixel(30);
GridClientSelectColumn col2 = new GridClientSelectColumn();
col2.UniqueName =
"checkBoxColumn";
grid.MasterTableView.Columns.Add(col2);
//grid.MasterTableView.Columns[2].HeaderStyle.Width = Unit.Percentage(4);
//grid.MasterTableView.Columns[2].HeaderStyle.Width = Unit.Pixel(30);
GridBoundColumn col3 = new GridBoundColumn();
col3.DataField =
"Tag";
col3.UniqueName = grid.MasterTableView.Name +
"colTag";
col3.HeaderText =
"Tag";
//col3.ReadOnly = true;
grid.MasterTableView.Columns.Add(col3);
//grid.MasterTableView.Columns[3].HeaderStyle.Width = Unit.Percentage(15);
GridBoundColumn col4 = new GridBoundColumn();
col4.DataField =
"ShortDescription";
col4.UniqueName = grid.MasterTableView.Name +
"colShortDescription";
col4.HeaderText =
"Short Description";
col3.MaxLength = 40;
grid.MasterTableView.Columns.Add(col4);
//grid.MasterTableView.Columns[4].HeaderStyle.Width = Unit.Percentage(15);
GridBoundColumn col5 = new GridBoundColumn();
col5.DataField =
"LongDescription";
col5.UniqueName = grid.MasterTableView.Name +
"colLongDescription";
col5.HeaderText =
"Long Description";
col5.MaxLength = 80;
grid.MasterTableView.Columns.Add(col5);
//grid.MasterTableView.Columns[5].HeaderStyle.Width = Unit.Percentage(25);
GridBoundColumn col6 = new GridBoundColumn();
col6.DataField =
"ShortDescription2";
col6.UniqueName = grid.MasterTableView.Name +
"colShortDescription2";
col6.HeaderText =
"Short Description 2";
col6.MaxLength = 40;
grid.MasterTableView.Columns.Add(col6);
//grid.MasterTableView.Columns[6].HeaderStyle.Width = Unit.Percentage(15);
GridHyperLinkColumn col7 = new GridHyperLinkColumn();
col7.UniqueName = grid.MasterTableView.Name +
"colCharacteristics2";
col7.HeaderText =
"Characteristics";
col7.DataNavigateUrlFields =
new string[] { "Id", "LongDescription" };
col7.DataNavigateUrlFormatString =
"javascript:ShowCharacteristics('{0}', '{1}');";
col7.Text =
"View";
grid.MasterTableView.Columns.Add(col7);
grid.MasterTableView.Columns[7].HeaderStyle.Width =
Unit.Percentage(10);
//grid.MasterTableView.Columns[7].HeaderStyle.Width = Unit.Pixel(50);
GridHyperLinkColumn col8 = new GridHyperLinkColumn();
col8.UniqueName = grid.MasterTableView.Name +
"colSRP";
col8.HeaderText =
"Quality Checks";
col8.DataNavigateUrlFields =
new string[] { "Id", "LongDescription" };
col8.DataNavigateUrlFormatString =
"javascript:ShowSRPs('{0}','{1}');";
col8.DataTextField =
"SRPViewText";
//col8.Text = "View";
grid.MasterTableView.Columns.Add(col8);
grid.MasterTableView.Columns[8].HeaderStyle.Width =
Unit.Percentage(10);
//grid.MasterTableView.Columns[8].HeaderStyle.Width = Unit.Pixel(50);
grid.NeedDataSource +=
new GridNeedDataSourceEventHandler(this.RadGridProducts_NeedDataSource);
grid.DetailTableDataBind +=
new GridDetailTableDataBindEventHandler(this.RadGridProducts_DetailTableDataBind);
grid.DeleteCommand +=
new GridCommandEventHandler(this.radGridProducts_DeleteCommand);
grid.UpdateCommand +=
new GridCommandEventHandler(this.RadGridProducts_UpdateCommand);
grid.InsertCommand +=
new GridCommandEventHandler(this.RadGridProducts_InsertCommand);
grid.ItemDataBound +=
new GridItemEventHandler(this.RadGridProducts_ItemDataBound);
grid.MasterTableView.CommandItemTemplate =
new ProductCommandItemTemplate();
grid.MasterTableView.CommandItemDisplay =
GridCommandItemDisplay.Top;
// Add the grid to the placeholder
this.PlaceHolder1.Controls.Add(grid);