Using RadGrid (asp.net 2.0) VS 2008, my grouped items are collapsed. I am grouping by multiple items, the initial view looks good, once I expand, I do not see the aggregate value. I have attached an image before and after expanding.
| <telerik:RadGrid ID="grid" runat="server" |
| DataSourceID="LinqDataSource1" AutoGenerateColumns="False" |
| AllowSorting="True" |
| GridLines="None" ShowGroupPanel="True" ShowFooter="true" |
| ongroupschanging="OnGroupChanged" Skin="WebBlue" |
| > |
| <ClientSettings AllowDragToGroup="true" AllowColumnsReorder="true" |
| ReorderColumnsOnClient="True"></ClientSettings> |
| <MasterTableView GroupsDefaultExpanded="false" ShowGroupFooter="true"> |
| <Columns> |
| <telerik:GridBoundColumn DataField="Participant" HeaderText="Participant" |
| SortExpression="Participant" UniqueName="Participant"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="activityType" HeaderText="Activity Type" |
| SortExpression="activityType" UniqueName="activityType"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="Items" HeaderText="Items" Groupable="false" |
| SortExpression="Items" UniqueName="Items" Aggregate="sum" FooterText="Total: " FooterAggregateFormatString="Total: {0:###,###}"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="EntityType" HeaderText="Entity Type" |
| SortExpression="EntityType" UniqueName="EntityType"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="Entity" HeaderText="Entity" |
| SortExpression="Entity" UniqueName="Entity"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="Region" HeaderText="Region" |
| SortExpression="Region" UniqueName="Region"> |
| </telerik:GridBoundColumn> |
| </Columns> |
| <GroupByExpressions> |
| <telerik:GridGroupByExpression> |
| <GroupByFields> |
| <telerik:GridGroupByField fieldName="Participant" /> |
| </GroupByFields> |
| <SelectFields> |
| <telerik:GridGroupByField fieldName="Participant" HeaderText="Participant" /> |
| </SelectFields> |
| </telerik:GridGroupByExpression> |
| <telerik:GridGroupByExpression> |
| <GroupByFields> |
| <telerik:GridGroupByField fieldName="activityType" /> |
| </GroupByFields> |
| <SelectFields> |
| <telerik:GridGroupByField fieldName="activityType" HeaderText="Activity Type" /> |
| </SelectFields> |
| </telerik:GridGroupByExpression> |
| <telerik:GridGroupByExpression> |
| <GroupByFields> |
| <telerik:GridGroupByField fieldName="EntityType" /> |
| </GroupByFields> |
| <SelectFields> |
| <telerik:GridGroupByField fieldName="EntityType" HeaderText="Entity Type" /> |
| </SelectFields> |
| </telerik:GridGroupByExpression> |
| </GroupByExpressions> |
| </MasterTableView> |
| </telerik:RadGrid> |
| <telerik:RadGrid EnableViewState="true" EnableEmbeddedSkins="False" Skin="ABCustom" OnItemDataBound="RadGrid2_ItemCommand" |
| runat="server" ID="productrelations" OnNeedDataSource="datarelations" OnInsertCommand="RadGrid2_InsertCommand" |
| AutoGenerateColumns="false" AllowSorting="true" > |
| <MasterTableView NoMasterRecordsText="Er zijn momenteel geen vergelijkbare producten geselecteerd" |
| CommandItemDisplay="Top" DataKeyNames="ProductBaseId"> |
| <Columns> |
| <telerik:GridBoundColumn UniqueName="ProductBaseId" HeaderText="ProductBaseId" DataField="ProductBaseId" |
| SortExpression="ProductBaseId" Visible="false" ReadOnly="true" /> |
| <telerik:GridTemplateColumn UniqueName="RelatedProducts" AllowFiltering="false" HeaderText="Vergelijkbare producten" |
| SortExpression="RelatedProductBaseId"> |
| <ItemTemplate> |
| <%# Eval("RelatedProductBase.Name")%> |
| </ItemTemplate> |
| <EditItemTemplate> |
| <asp:DropDownList runat="server" ID="relatedCategory" OnSelectedIndexChanged="fillproduct" |
| AutoPostBack="true" /> |
| <asp:DropDownList runat="server" ID="relatedProduct" /> |
| </EditItemTemplate> |
| </telerik:GridTemplateColumn> |
| <telerik:GridTemplateColumn AllowFiltering="false" ItemStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Right" HeaderText="Acties" UniqueName="Actions"> |
| <ItemTemplate> |
| <asp:ImageButton runat="server" ID="deleterelation" ImageUrl="~/Images/delete.png" |
| OnCommand="relation_OnClick" CommandArgument='<%# Eval("RelatedProductBaseId") %>' ToolTip="Delete" |
| OnClientClick="return confirm('Weet u zeker dat u de relatie met dit product wilt verwijderen?');" |
| CausesValidation="false" /> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
| </Columns> |
| <EditFormSettings EditColumn-ButtonType="ImageButton" EditColumn-InsertImageUrl="~/Images/SaveBtn.gif" |
| EditColumn-UpdateImageUrl="~/Images/SaveBtn.gif" EditColumn-CancelImageUrl="~/Images/CancelBtn.gif"> |
| </EditFormSettings> |
| <CommandItemSettings AddNewRecordText="Vergelijkbare producten toevoegen" AddNewRecordImageUrl="~/Images/AddRecord.gif" |
| RefreshText="Verversen" RefreshImageUrl="~/Images/Refresh.gif" /> |
| </MasterTableView> |
| </telerik:RadGrid> |
| protected void RadGrid2_ItemCommand(object source, Telerik.Web.UI.GridItemEventArgs e) |
| { |
| if ((e.Item is GridEditFormItem) && e.Item.IsInEditMode) |
| { |
| PrefetchPath prefetch = new PrefetchPath(EntityType.CategoryBaseEntity); |
| prefetch.Add(CategoryBaseEntity.PrefetchPathSubCategoryBase); |
| GridEditFormItem categorydopdown = (GridEditFormItem)e.Item; |
| DropDownList dropdownlistcategory = (DropDownList)categorydopdown.FindControl("relatedCategory"); |
| CategoryBaseCollection theCategoryColl = new CategoryBaseCollection(); |
| theCategoryColl.GetMulti(CategoryBaseFields.IsActive == true, prefetch); |
| dropdownlistcategory.Items.Add(new ListItem("- Selecteer een Category -", "0")); |
| foreach (CategoryBaseEntity category in theCategoryColl) |
| { |
| dropdownlistcategory.Items.Add(new ListItem(category.Name, category.Id.ToString())); |
| foreach (SubCategoryBaseEntity subCategory in category.SubCategoryBase) |
| { |
| dropdownlistcategory.Items.Add(new ListItem(".." + subCategory.Name, ".." + subCategory.Id.ToString())); |
| } |
| } |
| } |
| } |
| protected void RadGrid2_InsertCommand(object source, GridCommandEventArgs e) |
| { |
| GridEditFormInsertItem insertitems = (GridEditFormInsertItem)e.Item; |
| ProductRelationBaseEntity newproduct = new ProductRelationBaseEntity(); |
| DropDownList deliverytime = (DropDownList)insertitems.FindControl("relatedProduct"); |
| newproduct.ProductBaseId = Url.QueryStringParser.GetInt("ProductId"); |
| newproduct.RelatedProductBaseId = int.Parse(deliverytime.SelectedValue); |
| newproduct.Save(); |
| productrelations.DataBind(); |
| } |
| protected void fillproduct(object sender, EventArgs e) |
| { |
| DropDownList dropdownlistcategory = (DropDownList)sender; |
| DropDownList dropdownlistprodudct = (DropDownList)dropdownlistcategory.Parent.FindControl("relatedProduct"); |
| ProductBaseCollection productcollection = new ProductBaseCollection(); |
| if (dropdownlistcategory.SelectedItem.Text.Substring(0, 2) == "..") |
| { |
| productcollection.GetMulti(ProductBaseFields.SubCategoryBaseId == int.Parse(dropdownlistcategory.SelectedValue.Substring(2, dropdownlistcategory.SelectedValue.Length - 2)) & ProductBaseFields.IsDeleted == false); |
| } |
| else |
| { |
| productcollection.GetMulti(ProductBaseFields.CategoryId == int.Parse(dropdownlistcategory.SelectedValue) & ProductBaseFields.IsDeleted == false); |
| } |
| dropdownlistprodudct.Items.Clear(); |
| dropdownlistprodudct.Items.Add(new ListItem("- Selecteer een product -", "0")); |
| foreach (ProductBaseEntity product in productcollection) |
| { |
| ProductRelationBaseEntity productrelation = new ProductRelationBaseEntity(Url.QueryStringParser.GetInt("ProductId"), product.Id); |
| if (productrelation.IsNew == true && Url.QueryStringParser.GetInt("ProductId") != product.Id) |
| dropdownlistprodudct.Items.Add(new ListItem(product.Name, product.Id.ToString())); |
| } |
| } |
| protected void datarelations(object source, GridNeedDataSourceEventArgs e) |
| { |
| ProductRelationBaseCollection product = new ProductRelationBaseCollection(); |
| product.GetMulti(ProductRelationBaseFields.ProductBaseId == Url.QueryStringParser.GetInt("ProductId")); |
| productrelations.DataSource = product; |
| } |
I place the RadFormDecorator1 see below.
I want no roundedcorners so EnableRoundedCorners="false"
But now the textboxes have no styling at all.
They look the same as if i have no styling at all.
What am i doing wrong?
| <form id="Form1" method="post" runat="server"> |
| <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> |
| </telerik:RadScriptManager> |
| <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" |
| DecoratedControls="All" Skin="Office2007" EnableRoundedCorners="false" |
| /> |
Hi,
I used the TextBoxTemplate which Nick provided.. in my code.. In my case, am creating the radcombo dynamically from code behind.. and adding the item template also dynamically from code behind. But its not displaying the values, Instead it creates text boxes with out any text.. And I want to set the the Initial value also like 'Select one'.. Its displaying "System.Data.DataRowView" in DropDown.. If I click it is displaying textboxes without text.. How can I solve this..
In designing we can give like <asp:TextBox id="text1" runat="server" Text='<%=Eval("Name") %>' />.. Like that how to do for text box in template of rad combo in code behind c#
| class TextBoxTemplate : ITemplate |
| { |
| string ColName = "Text"; |
| public void InstantiateIn(Control container) |
| { |
| TextBox textBox = new TextBox(); |
| textBox.ID = "tabTextBox"; |
| textBox.DataBinding += new EventHandler(this.txt_DataBind); |
| container.Controls.Add(textBox); |
| } |
| public void txt_DataBind(Object sender, EventArgs e) |
| { |
| TextBox txt = (TextBox)sender; |
| RadComboBoxItem radCombo = (RadComboBoxItem)txt.NamingContainer; |
| txt.Text = DataBinder.Eval(radCombo, ColName).ToString(); |
| } |
| } |
| /*-------------- Dynamic creation of rad combo----------------*/ |
| RadComboBox RadDropDownShopper = new RadComboBox(); |
| RadDropDownShopper.ID = "RadDropdownShopper" + i.ToString(); |
| RadDropDownShopper.Attributes.Add("style", "padding-top: 8px;"); |
| RadDropDownShopper.Attributes.Add("style", "padding-left: 30px;"); |
| RadDropDownShopper.ItemTemplate = new TextBoxTemplate(); |
| RadDropDownShopper.DataSource = FakeDataTable(); |
| RadDropDownShopper.DataBind(); |
| ("Select Shopper/Member")); |
| tdShopper.Controls.Add(RadDropDownShopper); |
Thanks in advance
Nimmi