Hi,
i open a radwindow fro ma button inside a templatecolumn in a detailtable.
In the radwindow i have a radbutton when i click it the OnClick event doesn't fire.
Here the code.
<%@ Page Title="" Language="C#" MasterPageFile="~/SiteT.Master" AutoEventWireup="true" CodeBehind="AnalisiExc.aspx.cs" Inherits="IPadAdmin.AnalisiExc" %>
Hello!
As you can see in the image that I attached, my radgrid has 2 buttons at the bottom (Valider & Annuler) which stands for Validate and Cancel in english. These buttons are added as the following:
<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column" ButtonType="PushButton" InsertText="Valider" CancelText="Annuler" EditText="Modif" UpdateText="Valider">
</EditColumn>
</EditFormSettings>
I would like to change their design and apply a skin. I have applied the Material skin to the whole RadGrid however these buttons seem to not be affected by that. Would that be possible to style them, just like we style any radbutton using Skins? Would changing the ButtonType from pushbutton to another type help with this matter?
Here's the full code of the radgrid shown in the attached image:
<telerik:RadGrid ID="RadGrid1" runat="server" CellSpacing="0" Culture="French (France)"
DataSourceID="SDS_Notes" GridLines="None" Width="775px" Skin="Material"
AllowAutomaticInserts="True" AutoGenerateEditColumn="True">
<HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
</HeaderContextMenu>
<MasterTableView AutoGenerateColumns="False" CommandItemDisplay="Top" DataSourceID="SDS_Notes"
NoMasterRecordsText="Aucune note" DataKeyNames="NumNote"
AllowAutomaticUpdates="True"
Font-Size="13px">
<CommandItemSettings ExportToPdfText="Export to PDF" AddNewRecordText="Ajouter une note"
RefreshText="Rafraichir"></CommandItemSettings>
<RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
<ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
<Columns>
<telerik:GridDropDownColumn DataField="AgenceAction" FilterControlAltText="Filter AgenceAction column"
HeaderText="Agence" SortExpression="AgenceAction" UniqueName="AgenceAction" HeaderStyle-Width="61px" DataSourceID="SDSAgence" ListTextField="AgenceAction" ListValueField="AgenceAction" ItemStyle-Width="130px">
<HeaderStyle Font-Size="15px" Width="80px"></HeaderStyle>
</telerik:GridDropDownColumn>
<telerik:GridDateTimeColumn DataField="DateAction" DataType="System.DateTime" FilterControlAltText="Filter DateAction column"
HeaderText="Date Action" SortExpression="DateAction" UniqueName="DateAction"
DataFormatString="{0:dd/MM/yyyy}" HeaderStyle-Width="110px">
<HeaderStyle Font-Size="15px" Width="130px"></HeaderStyle>
</telerik:GridDateTimeColumn>
<telerik:GridDateTimeColumn DataField="HeureAction" DataType="System.DateTime" FilterControlAltText="Filter HeureAction column"
HeaderText="Heure" SortExpression="HeureAction" UniqueName="HeureAction" PickerType="TimePicker"
DataFormatString="{0:HH:mm}" HeaderStyle-Width="70px">
<HeaderStyle Font-Size="15px" Width="60px"></HeaderStyle>
</telerik:GridDateTimeColumn>
<telerik:GridBoundColumn DataField="Observations" FilterControlAltText="Filter Observations column"
HeaderText="Observations" SortExpression="Observations" UniqueName="Observations"
HeaderStyle-Width="500px" MaxLength="105">
<HeaderStyle Font-Size="15px" Width="500px"></HeaderStyle>
<ItemStyle CssClass="form-control" />
</telerik:GridBoundColumn>
</Columns>
<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column" ButtonType="PushButton" InsertText="Valider" CancelText="Annuler" EditText="Modif" UpdateText="Valider">
</EditColumn>
</EditFormSettings>
<HeaderStyle BackColor="#757575" Font-Bold="false" ForeColor="White"/>
</MasterTableView>
<FilterMenu EnableImageSprites="False">
</FilterMenu>
</telerik:RadGrid>
I have tried setting the SkinID from codebehind in the itemcreated property however I am receiving the following error:
"The 'SkinId' property can only be set in or before the Page_PreInit event for static controls. For dynamic controls, set the property before adding it to the Controls collection."
Protected Sub RadGrid1_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemCreated
If TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode Then
If Not e.Item.OwnerTableView.IsItemInserted Then
'[......]
Else
'[......]
End If
Dim cancelButton As Button = CType(e.Item.FindControl("CancelButton"), Button)
cancelButton.SkinID = "Material"
End If
End Sub
Hi
I have a RadButton with ButtonType="LinkButton".
I want remove the link from Head Office by following code.
ASPX
<telerik:GridTemplateColumn HeaderText="Branch" HeaderStyle-Width="10%" DataType="System.String" UniqueName="Branch" DataField="Branch">
<ItemTemplate>
<telerik:RadButton ID="btnBranch" Width="100%" runat="server" Text='<%#Eval("Branch") %>' ButtonType="LinkButton" ToggleType="CustomToggle"
Font-Underline="true" BorderStyle="None" CommandName="ViewBranchDtls" CommandArgument='<%#Eval("Branch") %>'>
</telerik:RadButton>
<asp:HiddenField ID="hdBranch" runat="server" Value='<%#Eval("Branch") %>' />
</ItemTemplate>
</telerik:GridTemplateColumn>
CS
protected void gvReport_ItemDataBound(object sender, GridItemEventArgs e) { try { if (e.Item is GridDataItem) { GridDataItem item = e.Item as GridDataItem; if ((item.FindControl("btnBranch") as RadButton).Text == "HEAD OFFICE" ) { (e.Item.FindControl("btnBranch") as RadButton).Style.Add("pointer-events", "none"); // here need to remove the underline } } } catch (Exception ex) { } finally { } }
sample Extracted HTML
<td>
<a id="ctl00_ContentPlaceHolder1_gvReport_ctl00_ctl12_btnBranch" class="RadButton RadButton_Default rbLinkButton" href="javascript:void(0)" style="display:inline-block;border-style:None;text-decoration:underline;width:100%;pointer-events:none;text-decoration:none;"><span class="rbText" style="text-decoration:underline;width:100%;padding-left:0;padding-right:0;text-align:center;">HEAD OFFICE</span><input id="ctl00_ContentPlaceHolder1_gvReport_ctl00_ctl12_btnBranch_ClientState" name="ctl00_ContentPlaceHolder1_gvReport_ctl00_ctl12_btnBranch_ClientState" type="hidden" autocomplete="off"></a>
<input type="hidden" name="ctl00$ContentPlaceHolder1$gvReport$ctl00$ctl12$hdBranch" id="ctl00_ContentPlaceHolder1_gvReport_ctl00_ctl12_hdBranch" value="HEAD OFFICE">
</td>
I notice Telerik will auto generate SPAN with underline.
How to remove the underline?
Thanks.
fsloke
the problem is that i declared the function of onitemdatabound but theres an error that says it cant find the cell bound
for example i have a telerik: gridtemplatecolumn with unique name action and meta resourcekey gtcaction
then i have an item template where i have an imagebutton with present the id
I'd like to have a RadButton whose icon differs between two images depending on the value of the field. I'm not sure if this is the best approach, but I am defaulting to one specific icon and attempting to change it in the _ItemDataBound method. However, I can't seem to figure out how to access the icon from the RadButton:
<ItemTemplate>
<telerik:RadButton RenderMode="Lightweight" ID="Image2"
CommandName="OnCommentToggleHandled" runat="server">
<Icon PrimaryIconUrl='<%# DataBinder.Eval(Container.DataItem, "Dismissed").Equals(true) ? "/App/images/green-check.png" : "/App/images/comment.gif" %>' runat="server"></Icon>
</telerik:RadButton>
</ItemTemplate>
protected void StatusGrid_ItemDataBound(object sender, GridItemEventArgs e)
{
if (e.Item is GridDataItem)
{
GridDataItem dataBoundItem = e.Item as GridDataItem;
RadButton foo = dataBoundItem["Dismissed"].Controls[1] as RadButton;
if ((dataBoundItem["Important"].Controls[1] as Image).ImageUrl.Contains("green-check.png"))
{
dataBoundItem.BackColor = System.Drawing.Color.LemonChiffon;
}
else if ((dataBoundItem["Dismissed"].Controls[1] as RadButton).PrimaryIconUrl.Contains("blank.gif"))
{
e.Item.CssClass = "rgRow unhandledMessage ";
}
dataBoundItem["Text"].Text = WebUtility.HtmlDecode(dataBoundItem["Text"].Text);
}
}
Hi,
I have a Gridhyprlink column with a DataNavigateUrlFormatString and 2 DataNavigateUrlFields
however I want one of those fileds to be conditional on another Column;
eg
DataNavigateUrlFormatString="https://main.aspx?etn={0}&pagetype=entityrecord&id={1}"
DataNavigateUrlFields= ((if (entityid ==2) {a} else {b}) ,mainid )
Hello,
I'm currently working on a project where I have a RadGrid displaying some data. The filter functionality is already implemented and I've created a custom skin from an existing embedded skin for the GridDateTimeColumn and implemented according to the documentation here. Everything works perfect except that upon adding the <FilterTemplate> and setting the custom skin for the <telerik:RadDatePicker> the filter button it's not generated anymore. I've inspected the page and indeed the button is not just hidden with CSS or missing it's icon, it's not present at all in the HTML and the result is in the pictures attached.
Here is the markup I'm using.
<telerik:GridDateTimeColumn DataField="foo" UniqueName="foo" HeaderText="foo" PickerType="DatePicker" DataFormatString="{0: MM/dd/yyyy}" FilterDateFormat="MM/dd/yyyy" ReadOnly="true">
<HeaderStyle Width="130" Font-Bold="true" />
<FilterTemplate>
<telerik:RadDatePicker runat="server" Skin="MyCustomSkin" EnableEmbeddedSkins="false"></telerik:RadDatePicker>
</FilterTemplate>
</telerik:GridDateTimeColumn>
Once I remove the <FilterTemplate> and return the skin to default the Filter button is displayed. I've looked for solutions but I couldn't seem to find any. What's causing this behaviour? Is it something I'm missing?