I have a row of totals in my grid. I add a custom footer to my grid where I add a grand total for 3 total columns to the last cell. I add a <br /> and to all the other cells as shown below.
if (e.Item is GridFooterItem) { GridFooterItem footerItem = (GridFooterItem)e.Item; { double a= 0; double b= 0; double c= 0; double sumA = 0; double sumB = 0; double sumC = 0; double total = 0; foreach (GridDataItem item in e.Item.OwnerTableView.Items) { a= Double.Parse(item["A"].Text, NumberStyles.Currency); sumA += a; b= Double.Parse(item["B"].Text, NumberStyles.Currency); sumB += b; c= Double.Parse(item["C"].Text, NumberStyles.Currency); sumC += c; } total = sumA + sumB + sumC; footerItem["A"].Text = sumA .ToString("c2") + "<br /> "; footerItem["B"].Text = sumB .ToString("c2") + "<br /> "; footerItem["C"].Text = sumC.ToString("c2") + "<br />" + total.ToString("c2"); }
on my excel export the blank cell does not show. It seems excel is ignoring the line break and empty cell and just bottom aligning the total for me. See attached.
I even tried the approach in some other threads to replace the <br /> with but that just takes the new line away completely.
protected void grid_GridExporting(object sender, GridExportingArgs e) { RadGrid grid = (RadGrid)sender; e.ExportOutput = e.ExportOutput.Replace("<br />", "
"); }

Dim editedItem As GridEditableItem = NothingIf RadGrid1.MasterTableView.IsItemInserted Then editedItem = RadGrid1.MasterTableView.GetInsertItem()End IfIf IsNothing(editedItem) Then editedItem = RadGrid1.EditItems.Item(0)End If Dim ddl As DropDownList = CType(editedItem.FindControl("ddlId"), DropDownList)ddl.Items.Insert(0, newValue)ddl.SelectedValue = newValue
I'm currently using R2 2018 SP1 and I'm experiencing a display issue with the grouping header. In my project, I have two grids that are very similar. Both use grouping but one one grid has static headers.
When I use static headers, the grouping header show the column grid lines (i.e. row renders a <TD> for each column). But when I just simply remove theUseStaticHeaders="true" attribute, the grouping row is displayed as expected without the column grid lines (i.e. row renders with as one TD and a colspan attribute). Also note that I'm using the WebBlue theme.
See the attached screenshots displaying both situations.
I was unable to find this specific situation in the current grid demo so I was unable to confirm if this is a problem in the current release.
Thanks
Loy.




protected void Page_Load(object sender, EventArgs e) { if (Session["GridData"] == null) { DataTable table = GetTable(); Session.Add("GridData", table); } DefineGridStructure(); } private void DefineGridStructure() { RadGrid grid = new RadGrid(); grid.ID = "RadGrid1"; grid.NeedDataSource += new GridNeedDataSourceEventHandler(grid_NeedDataSource); grid.AutoGenerateEditColumn = true; grid.AutoGenerateDeleteColumn = true; grid.AllowAutomaticInserts = false; grid.Width = Unit.Percentage(100); grid.PageSize = 15; grid.AllowPaging = true; grid.PagerStyle.Mode = GridPagerMode.NextPrevAndNumeric; grid.AutoGenerateColumns = false; grid.MasterTableView.Width = Unit.Percentage(100); grid.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.TopAndBottom; grid.AllowAutomaticDeletes = false; grid.AllowAutomaticUpdates = false; grid.InsertCommand +=grid_InsertCommand; grid.MasterTableView.DataKeyNames = new string[] { "RowNumber" }; GridBoundColumn boundColumn = new GridBoundColumn(); boundColumn.DataField = "RowNumber"; boundColumn.HeaderText = "RowNumber"; boundColumn.ReadOnly = true; grid.MasterTableView.Columns.Add(boundColumn); boundColumn = new GridBoundColumn(); boundColumn.DataField = "Size"; boundColumn.HeaderText = "Size"; grid.MasterTableView.Columns.Add(boundColumn); boundColumn = new GridBoundColumn(); boundColumn.DataField = "Description"; boundColumn.HeaderText = "Description"; grid.MasterTableView.Columns.Add(boundColumn); boundColumn = new GridBoundColumn(); boundColumn.DataField = "Quantity"; boundColumn.HeaderText = "Quantity"; grid.MasterTableView.Columns.Add(boundColumn); boundColumn = new GridBoundColumn(); boundColumn.DataField = "Duration"; boundColumn.HeaderText = "Duration"; grid.MasterTableView.Columns.Add(boundColumn);
// Added code snipet to create the drowpdown menu from an itemplate
GridTemplateColumn objGridTemplateColumn = new GridTemplateColumn();
objGridTemplateColumn.HeaderText = "DurationType";
objGridTemplateColumn.UniqueName = "DurationType";
objGridTemplateColumn.ItemTemplate = new MyTemplate("DurationType");
grid.MasterTableView.Columns.Add(objGridTemplateColumn);
boundColumn = new GridBoundColumn(); boundColumn.DataField = "Amount"; boundColumn.HeaderText = "Amount"; grid.MasterTableView.Columns.Add(boundColumn); PlaceHolder1.Controls.Add(grid); } private void grid_InsertCommand(object sender, GridCommandEventArgs e) { // Looking to loop through the form so i can insert the values into the datatable } void grid_NeedDataSource(object sender, GridNeedDataSourceEventArgs e) { DataTable current = (DataTable)Session["GridData"]; RadGrid grid = (RadGrid)sender; grid.DataSource = current; } static DataTable GetTable() { // // Here we create a DataTable with a few columns. // // Create Datatable to store all colums DataTable dt = new DataTable(); DataRow dr = null; dt.Columns.Add(new DataColumn("RowNumber", typeof(string))); dt.Columns.Add(new DataColumn("Size", typeof(string))); dt.Columns.Add(new DataColumn("Description", typeof(string))); dt.Columns.Add(new DataColumn("Quantity", typeof(string))); dt.Columns.Add(new DataColumn("Unit", typeof(string))); dt.Columns.Add(new DataColumn("Duration", typeof(string))); dt.Columns.Add(new DataColumn("DurationType", typeof(string))); dt.Columns.Add(new DataColumn("Amount", typeof(string))); dr = dt.NewRow(); dr["RowNumber"] = 1; dr["Size"] = string.Empty; dr["Description"] = string.Empty; dr["Quantity"] = string.Empty; dr["Unit"] = string.Empty; dr["Duration"] = string.Empty; dr["DurationType"] = string.Empty; dr["Amount"] = string.Empty; dt.Rows.Add(dr); return dt; }
My website is focused on the NFL and its most engaged fans. These people enjoy following the NFL Draft, which is the annual selection process that determines what pro football teams graduating college players will play for. Our audience is very opinionated on the Draft, and we give them the ability to put the players in their own sort order based on their own opinions.
You do not need an account to see what this looks like: http://football.powerhousegm.com/DraftRoom/BigBoard2.aspx?v=s
There are about 1,200 players in this list; 100 per page. Each player has a specific slot in the overall order ("Rank") and users can put them in broader tiers by assigning a "Grade" (if you look at the page, the pink "R1+/R1" is the highest Grade.) Click on the pink button to see how a user would change the Grade.
We've run into trouble with this process (which does not use Telerik controls... yet.) Changing a Grade should move the player into the range in the overall order where similarly Graded players sit. But, where specifically in that order? At the top of that group if the player is being downgraded, and at the bottom of the higher tier if the user is changing his Grade to a higher one? In short, it's a messy process that I haven't solved logically, and thus haven't solved technically.
Does anyone have a good idea how we could handle this that would provide the best user experience?
The idea I'm toying with right now is to have tabs across the top of the list for each possible Grade, and grabber handles or something to allow the user to drag/drop prospects up/down in the list on each particular tab... or up/down buttons to move them one slot at a time. The user could still change the Grade, which would move the player to another tab.
Thanks in advance for any ideas/guidance!
Chris Barry
I'm having NO LUCK trying to get a RadGrid to auto size it's height … here is what I'm trying to achieve (which seems simple to me) within RadPageLayout row:
1. Set Grid's min-height and max-height
2. Have the Grid auto size based on content and staying within the confines of min-Height and max-Height
I've search for answers and see the question has come up very often but the solutions are incredibly worky and not reliable for a task that is very simple. Is there an easy solution to this without having to write 100's of lines of code?
I buy Telerik products to avoid having to write all this code, so I'm hoping this is a simple solution.
Cheers, Rob.