or
<telerik:RadGrid ID="OrderItemGrid" runat="server" AutoGenerateColumns="False" CellSpacing="0" GridLines="None"> <MasterTableView CommandItemDisplay="Top" DataKeyNames="OrderItemID" EditMode="InPlace"> <CommandItemSettings ExportToPdfText="Export to PDF" AddNewRecordText="Quick-Add New Order Item" /> <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" Visible="True"> </RowIndicatorColumn> <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" Visible="True"> </ExpandCollapseColumn> <Columns> <telerik:GridBoundColumn DataField="OrderItemID" FilterControlAltText="Filter OrderItemID column" HeaderText="Item ID" ReadOnly="True" UniqueName="OrderItemID"> </telerik:GridBoundColumn> <telerik:GridTemplateColumn DataField="CatID" FilterControlAltText="Filter CatID column" HeaderText="Category" UniqueName="CatID"> <EditItemTemplate> <asp:DropDownList ID="DDCategory" runat="server"></asp:DropDownList> </EditItemTemplate> <InsertItemTemplate> <asp:DropDownList ID="DDCategory" runat="server"></asp:DropDownList> </InsertItemTemplate> <ItemTemplate> <asp:Label ID="CatIDLabel" runat="server" Text='<%# Eval("CatID") %>'></asp:Label> </ItemTemplate> </telerik:GridTemplateColumn>Protected Sub OrderItemGrid_ItemDataBound(ByVal sender As Object, ByVal e As GridItemEventArgs) Handles OrderItemGrid.ItemDataBound If TypeOf (e.Item) Is GridEditFormInsertItem And e.Item.IsInEditMode Then Dim editItem As GridEditFormInsertItem = CType(e.Item, GridEditFormInsertItem) Dim dropList As DropDownList = CType(editItem("CatID").FindControl("DDCategory"), DropDownList) Using dbContext As New MatrixORMModelVB() dropList.DataSource = dbContext.Categories.ToList() dropList.DataTextField = "CategoryName" dropList.DataValueField = "CategoriesID" dropList.DataBind() End Using ElseIf TypeOf (e.Item) Is GridDataItem And Not e.Item.IsInEditMode Then Dim editItem As GridDataItem = CType(e.Item, GridDataItem) Dim label As Label = CType(editItem("CatID").FindControl("CatIDLabel"), Label) Using dbContext As New MatrixORMModelVB() Dim temp As String = label.Text Dim tempCat As MatrixORM.Category = dbContext.Categories.Where(Function(c) c.CategoriesID = temp).First() label.Text = tempCat.CategoryName End Using End IfEnd SubTreeListEditCommandColumn , from that i can able to hide the plus button in the parent node. or i can set the visible true/false.
<telerik:RadTreeList ID="treeListClientBudget" runat="server" OnNeedDataSource="treeListClientBudget_NeedDataSource" Visible="false" HideExpandCollapseButtonIfNoChildren="true" DataKeyNames="DataKey" Height="200px" OnChildItemsDataBind="treeListClientBudget_ChildItemsDataBind" OnItemDataBound="treeListClientBudget_ItemDataBound" ParentDataKeyNames="ParentKey" AutoGenerateColumns="false" AllowLoadOnDemand="true" EditMode="InPlace" OnUpdateCommand="treeListClientBudget_UpdateCommand" OnInsertCommand="treeListClientBudget_InsertCommand" OnCancelCommand="treeListClientBudget_CancelCommand" OnEditCommand="treeListClientBudget_EditCommand"> <ClientSettings Selecting-AllowItemSelection="true" Scrolling-AllowScroll="true" Scrolling-UseStaticHeaders="true" > <Selecting AllowToggleSelection="true"/> </ClientSettings> <Columns> <telerik:TreeListEditCommandColumn UniqueName="InsertCommandColumn" ShowAddButton="false" ButtonType="ImageButton" ShowEditButton="false" HeaderStyle-Width="30px" ItemStyle-HorizontalAlign="Center"> <HeaderStyle Width="60px" /> <ItemStyle Width="60px" /> </telerik:TreeListEditCommandColumn> <telerik:TreeListButtonColumn CommandName="Edit" Text="Edit" UniqueName="EditCommandColumn" ButtonType="ImageButton" HeaderStyle-Width="30px" ItemStyle-HorizontalAlign="Center"> </telerik:TreeListButtonColumn> <telerik:TreeListButtonColumn UniqueName="DeleteCommandColumn" Text="Delete" CommandName="Delete" ButtonType="ImageButton" HeaderStyle-Width="30px"></telerik:TreeListButtonColumn> <telerik:TreeListBoundColumn DataField="DisplayName" UniqueName="DisplayName" ReadOnly="true" HeaderText="Month/Classification"> </telerik:RadTreeList>please refer the code for Codebehind .CS
protected void treeListClientBudget_ItemDataBound(object sender, TreeListItemDataBoundEventArgs e) { if (e.Item is TreeListDataItem) { TreeListDataItem item = e.Item as TreeListDataItem; //hdnClassificationId.Value = Convert.ToString(item.GetDataKeyValue("DataKey")); switch (item.HierarchyIndex.NestedLevel) { case 0: item.BackColor = System.Drawing.Color.LightYellow; break; case 1: item.BackColor = System.Drawing.Color.YellowGreen; ImageButton treelist = item["TreeListEditCommandColumn"].FindControl("InsertCommandColumn") as ImageButton; //treelist.ShowAddButton = true; // hdnClassificationId.Value =Convert.ToString( item.GetDataKeyValue("DataKey")); break; case 2: item.BackColor = System.Drawing.Color.LightPink; item["InsertCommandColumn"].Visible = true; break; } } }GridEditCommandColumn
but can not figure out the correct syntax.<httpRuntime encoderType="Microsoft.Security.Application.AntiXssEncoder, AntiXssLibrary" />
private void FillChart(IEnumerable<EntitySearchResponse> data) { SentimentChart.ChartTitle.Text = "Sentemants Per day"; SentimentChart.PlotArea.YAxis.TitleAppearance.Text = "Sentimants %"; SentimentChart.PlotArea.XAxis.LabelsAppearance.RotationAngle = 90; SentimentChart.PlotArea.XAxis.Step = 10; SentimentChart.PlotArea.XAxis.Items.Clear(); foreach (var date in data.Select(x => x.Date).Distinct()) { var axisItem = new AxisItem(date.ToString("ddd dd")); SentimentChart.PlotArea.XAxis.Items.Add(axisItem); } SentimentChart.DataSource = data; SentimentChart.PlotArea.Series.Clear(); foreach (var entityName in data.Select(x => x.EntityName).Distinct()) { var series = new ColumnSeries(); series.LabelsAppearance.DataFormatString = "{0} items"; series.TooltipsAppearance.DataFormatString = "{0} {2} items"; series.Name = entityName; var items = data.Where(x => x.EntityName == entityName).ToList(); foreach (var entitySearchResponse in items) { var seriesItem = new SeriesItem(entitySearchResponse.Sentiment); seriesItem.TooltipValue = string.Format("{0} Sentiment - {1} Volume", entitySearchResponse.Sentiment, entitySearchResponse.Volume); series.Items.Add(seriesItem); } SentimentChart.PlotArea.Series.Add(series); } }