protected void RadGrid1_PreRender(object sender, EventArgs e) { RadGrid RadGrid1 = (RadGrid)sender; if(RadGrid1.Items.Count==0) { RadGrid1.Visible = false; } }One of the GridTemplateColumn columns in my radgrid isn't populated by a database so its AllowFiltering property is set to false. However, I want to put a loading gif where <FilterTemplate> puts its markup.
How do I do this?
<telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="true" OnNeedDataSource="RadGrid1_NeedDataSource"> <Columns> <telerik:GridTemplateColumn UniqueName="MyCol1" AllowFiltering="false"> <FilterTemplate> <!-- I want to put image here, but it doesn't display if AllowFilter=false --> <img src="images/loading.gif" /> </FilterTemplate> <ItemTemplate> <asp:Hyperlink ID="MyLink" runat="server" Text="MyLink"></asp:Hyperlink> </ItemTemplate> </telerik:GridTemplateColumn> </Columns> </telerik:RadGrid>I have this thing in my grid view
<ItemTemplate>
<asp:ImageButton ID="ImageButton1" runat="server" AlternateText="Delete Customer"
OnClientClick="javascript:if(!confirm('This action will move the selected employee to his source store . Are you sure?')){return false;}"
CausesValidation="false"
OnClick = "RadGrid1_ItemDeleted1"
CommandName="Delete"
CommandArgument='<%# Eval("EmployeeNumber") %>'
ImageUrl="~/_Layouts/delete/images.jpg" />
</ItemTemplate>
Now in the click event how to I get the row for which the delete was clicked.
<
telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="true" PageSize="100" OnPageIndexChanged="RadGrid1_PageIndexChanged">
<MasterTableView CommandItemDisplay="TopAndBottom" PagerStyle-Position="TopAndBottom"
AutoGenerateColumns="true">
<ItemStyle Wrap="True" />
<HeaderStyle Wrap="False" Width="200px" />
<FilterItemStyle Wrap="False" />
<PagerStyle Mode="NextPrevAndNumeric" />
<CommandItemTemplate>
<telerik:RadMenu ID="RadOptionsMenu" runat="server" ClickToOpen="false"
EnableRoundedCorners="true" EnableShadows="true"
OnItemClick="RadOptionsMenu_Clicked"
Skin="Vista">
<CollapseAnimation Duration="200" Type="OutQuint" />
<Items>
<telerik:RadMenuItem AccessKey="x" CssClass="MenuText" Text="Export">
<Items>
<telerik:RadMenuItem runat="server" Text="Excel">
</telerik:RadMenuItem>
</Items>
</telerik:RadMenuItem>
</Items>
</telerik:RadMenu>
<table width="100%">
<tr>
<td style="height: 10px;">
</td>
</tr>
</table>
</CommandItemTemplate>
</MasterTableView>
<ClientSettings>
</ClientSettings>
</telerik:RadGrid>
RadAjaxPanel also.
Please help me.
Thanks
Ratheesh
protected void makeStockChart() { RadChart stockChart = new RadChart(); stockChart.ChartTitle.Visible = false; stockChart.Appearance.Border.Visible = false; stockChart.Legend.Appearance.Visible = false; stockChart.PlotArea.YAxis.Appearance.Visible = Telerik.Charting.Styles.ChartAxisVisibility.False; stockChart.PlotArea.Appearance.FillStyle.MainColor = System.Drawing.Color.White; stockChart.PlotArea.Appearance.FillStyle.SecondColor = System.Drawing.Color.White; stockChart.PlotArea.Appearance.Border.Color = System.Drawing.Color.White; // Create a ChartSeries and assign its name and chart type ChartSeries chartSeries = new ChartSeries(); chartSeries.Name = "Count"; chartSeries.Type = ChartSeriesType.Bar; // Open SQL Connection SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString); connection.Open(); SqlCommand command = new SqlCommand("GetStockData", connection); command.CommandType = CommandType.StoredProcedure; SqlDataReader reader = command.ExecuteReader(); while (reader.Read()) { // Pretty up the value string value = string.Format("{0:d}", (reader.GetValue(1))); // Set value and value text ChartSeriesItem chartSeriesItem = new ChartSeriesItem(Convert.ToDouble(reader.GetValue(1)), value); chartSeriesItem.Name = reader.GetValue(0).ToString(); chartSeries.AddItem(chartSeriesItem); } // Close SQL Connection connection.Close(); // add the series to the RadChart Series collection stockChart.Series.Add(chartSeries); // add the RadChart to the page. this.stockChart.Controls.Add(stockChart); }