Telerik Forums
UI for ASP.NET AJAX Forum
12 answers
417 views
<telerik:GridTemplateColumn HeaderText="Employee" ItemStyle-Width="150px" UniqueName="EmployeeName">
                                        <ItemTemplate>
                                            <asp:LinkButton ID="lblEmpName" runat="server" Text="" />
                                        </ItemTemplate>
</telerik:GridTemplateColumn>
I have a radgrid with gridtemplate column of type linkbutton like the sample shown.
1)  When i export the grid to excel, the linkbuttons still linkable,underlined,blue color. I want to export like any label not linkable,not     underlined and change it's font color.

2) I want to add worksheets to my excel file with different data sources.
Keith
Top achievements
Rank 1
 answered on 03 Oct 2013
7 answers
208 views
Please tell me how to validate the cell values.  If the two values are the same, error it out and do not update them.  Please refer to the PNG.
Angel Petrov
Telerik team
 answered on 03 Oct 2013
3 answers
367 views
I have a grid with two groupings - First group by leadtype, and then for each leadtype, group by Employee. I am able to get the groupings to work fine but can't figure out how to get the item count (lead count) to show correctly in the main group (lead type) header and each of the sub group (employee) header. I have studied the examples and documentation tried a number of different groupbyexpressions but I either get {0}  for the count or the groupings get all messed up.

Any help is appreciated!
Thanks

Charles

Here is the grid definition I have so far:
<telerik:RadGrid ID="rgLeads" ShowGroupPanel="false" AutoGenerateColumns="false" AllowSorting="true"
        ShowFooter="False" runat="server" GridLines="None"
    AllowPaging="true" PageSize="15" Width="100%" >
 
    <MasterTableView DataSourceID="sqldsLeads" ShowGroupFooter="false" CommandItemDisplay="Top" EditMode="InPlace" PagerStyle-PageSizes="15,25,50,100,250,500,1000">
        <PagerStyle AlwaysVisible="true"/>
        <CommandItemSettings ShowExportToExcelButton="true" ShowExportToCsvButton="true" ShowExportToWordButton="true" ShowAddNewRecordButton="false">
        </CommandItemSettings>
        <%--<GroupHeaderTemplate>
            <asp:Label runat="server" ID="Label3" style="font-weight:bold" Text='<%# Eval("LeadType")%>' ></asp:Label>
            <asp:Label runat="server" ID="Label1" style="font-weight:bold" Text='<%# "(" + Eval("TotalCount").ToString() + " Total)" %>' ></asp:Label>
        </GroupHeaderTemplate>--%>
        <Columns>
            <telerik:GridTemplateColumn HeaderText="ID">
                <ItemTemplate>
                     <asp:label runat="server" ID="lblTicketID" Text='<%# Eval("UpTicketID") %>' ></asp:label>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn>
                <ItemTemplate>
                     <asp:ImageButton runat="server" ID="imgbtnPrint" ImageUrl="images/print_16.gif" OnClick="imgbtnPrint_click" ToolTip="Print lead datasheet." />
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn HeaderText="Date" SortExpression="CreatedTDS">
                <ItemTemplate>
                     <asp:label runat="server" ID="lblDate" Text='<%# Format(Eval("CreatedTDS"),"M/d/yyyy") %>' ToolTip='<%# Format(Eval("CreatedTDS"),"t") %>' ></asp:label>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
                                                         
            <telerik:GridBoundColumn DataField="LeadType" HeaderText="Type" SortExpression="LeadType" Aggregate="Count" >
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="EmployeeName" HeaderText="Employee" SortExpression="EmployeeName" >
            </telerik:GridBoundColumn>
                                                                                                                 
            <telerik:GridTemplateColumn HeaderText="Name" SortExpression="Lname">
                <ItemTemplate>
                     <asp:HyperLink runat="server" ID="hlClientHistory" NavigateUrl='<%# "ClientHistory2.aspx?clientID=" + CStr(Eval("ClientID"))%>' Text='<%# Eval("ClientName") %>' Target="_blank" ></asp:HyperLink>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn HeaderText="Phone">
                <ItemTemplate>
                    <asp:label runat="server" ID="lblPhone" ></asp:label>
                </ItemTemplate>
                <ItemStyle Width="120px" />
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn HeaderText="Email">
                <ItemTemplate>
                     <a href='mailto:<%# Eval("EmailAddress") %>' style="font-family: Segoe UI, Arial, Verdana; font-size: 11px; color: #777697;"><%# Eval("EmailAddress") %></a>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn HeaderText="Address">
                <ItemTemplate>
                     <asp:label runat="server" ID="lblAddress" ></asp:label>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn HeaderText="Vehicle" SortExpression="Manufacturer">
                <ItemTemplate>
                     <asp:label runat="server" ID="lblVehicle" Text='<%# Eval("Vehicle") %>' ></asp:label>
                    <asp:LinkButton runat="server" ID="lbShowVehicle" OnClick="lbShowVehicle_click" Text='<%# Eval("Vehicle") %>' style="font-family: Segoe UI, Arial, Verdana; font-size: 11px; color: #777697;"></asp:LinkButton>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
        </Columns>
        <GroupByExpressions>
            <telerik:GridGroupByExpression>
                <GroupByFields>
                    <telerik:GridGroupByField FieldName="LeadType" FieldAlias="LeadType" >
                    </telerik:GridGroupByField>
                </GroupByFields>
                <SelectFields>
                    <telerik:GridGroupByField FieldName="LeadType" FieldAlias="LeadType" HeaderText="Lead Type" >
                    </telerik:GridGroupByField>
                    <%--<telerik:GridGroupByField FieldName="UpTicketID" FieldAlias="TicketCount" Aggregate="Count" >
                    </telerik:GridGroupByField>--%>
                </SelectFields>
            </telerik:GridGroupByExpression>
            <telerik:GridGroupByExpression>
                <GroupByFields>
                    <telerik:GridGroupByField FieldName="EmployeeName" FieldAlias="EmployeeName" >
                    </telerik:GridGroupByField>
                </GroupByFields>
                <SelectFields>
                    <telerik:GridGroupByField FieldName="EmployeeName" FieldAlias="EmployeeName" HeaderText="Employee" >
                    </telerik:GridGroupByField>
                    <%--<telerik:GridGroupByField FieldName="UpTicketID" FieldAlias="TicketCount" Aggregate="Count"  >
                    </telerik:GridGroupByField>--%>
                </SelectFields>
            </telerik:GridGroupByExpression>
        </GroupByExpressions>
    </MasterTableView>
    <ExportSettings ExportOnlyData="true" IgnorePaging="true">
        <Excel Format="Biff"></Excel>
    </ExportSettings>
 
    <ClientSettings AllowDragToGroup="true">
    </ClientSettings>
    <GroupingSettings ShowUnGroupButton="true" ></GroupingSettings>
</telerik:RadGrid>
Eyup
Telerik team
 answered on 03 Oct 2013
0 answers
99 views
Hey there, 

I am trying to generate the following 

onclick="return RunScript('/SC/ServiceModules/Handlers/ActionHandler.ashx?_o=48ba5dd8-35ff-4aff-9465-06501f4e6d53&amp;_an=STOP&amp;Name=b61f62b9-c191-45a5-ac8c-1e329ec5c3a2&amp;_pvg=034cd5fc-c1c0-4ec8-935a-53864241dcae&amp;_at=OMCommand','Are you sure you want to Turn Off?');" 

inside the area tag,  and using the following: 

string attri =onclick="return RunScript('/SC/ServiceModules/Handlers/ActionHandler.ashx?_o=48ba5dd8-35ff-4aff-9465-06501f4e6d53&amp;_an=STOP&amp;Name=b61f62b9-c191-45a5-ac8c-1e329ec5c3a2&amp;_pvg=034cd5fc-c1c0-4ec8-935a-53864241dcae&amp;_at=OMCommand','Are you sure you want to Turn Off?');" 


chartSeries.Items[j].ActiveRegion.Attributes = attri; 

but seems that the output always get rid of / character,and the onclick does not works

Thanks,T

Twu
Top achievements
Rank 1
 asked on 03 Oct 2013
1 answer
61 views
From what I've seen in testing it and what I've seen in posts it appears RadScheduler cannot be used with RadXmlHttpPanel.  Are there any plans to support this and if not can it be documented somewhere?

Boyan Dimitrov
Telerik team
 answered on 03 Oct 2013
1 answer
762 views
Hi I have a RadTextBox that has a Width set to 100%

<telerik:RadTextBox ID="tb_Tools" runat="server" ReadOnly="true" Width="100%"></telerik:RadTextBox>

In certain scenarios I need to change this to 90% so in my code behind I have the following in an If Then Statement....
If condition Then
    tb_Tools.Width = Unit.Percentage(90)
End If
Unfortunately in Visual Studio I get a wavy line under Unit.Percentage(90) and a ToolTips error stating....

Value of Type 'Telerik.Charting.Styles.Unit' cannot be converted to 'System.Web.UI.WebControls.Unit'.

What have I done wrong?
Mych
Top achievements
Rank 1
 answered on 03 Oct 2013
2 answers
138 views
I'm using the item databound event in radgrid to look at a status column and to change another column's font color and set it to bold if the status equals 3.  This works perfectly fine on all of the rows except for the last row.  Is there anything you can see with this code example that I'm missing to get this to apply to the last row as well?

        protected void rgGrid_ItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridDataItem)
            {
                foreach (GridDataItem item in rgGrid.Items)
                {
                    Label sunstat = item["sunstat"].FindControl("lbliSundayStat") as Label;
                    Label monstat = item["monstat"].FindControl("lbliMondayStat") as Label;
                    Label tuestat = item["tuestat"].FindControl("lbliTuesdayStat") as Label;
                    Label wedstat = item["wedstat"].FindControl("lbliSundayStat") as Label;
                    Label thustat = item["thustat"].FindControl("lbliSundayStat") as Label;
                    Label fristat = item["fristat"].FindControl("lbliSundayStat") as Label;
                    Label satstat = item["satstat"].FindControl("lbliSundayStat") as Label;

                    Label sun = item["Sunday"].FindControl("lbliSunday") as Label;
                    Label mon = item["Monday"].FindControl("lbliMonday") as Label;
                    Label tue = item["Tuesday"].FindControl("lbliTuesday") as Label;
                    Label wed = item["Wednesday"].FindControl("lbliWednesday") as Label;
                    Label thu = item["Thursday"].FindControl("lbliThursday") as Label;
                    Label fri = item["Friday"].FindControl("lbliFriday") as Label;
                    Label sat = item["Saturday"].FindControl("lbliSaturday") as Label;
                    if (sunstat.Text == "3")
                    {
                        sun.ForeColor = Color.Red;
                        sun.Font.Bold = true;
                    }
                    if (monstat.Text == "3")
                    {
                        mon.ForeColor = Color.Red;
                        mon.Font.Bold = true;
                    }
                    if (tuestat.Text == "3")
                    {
                        tue.ForeColor = Color.Red;
                        tue.Font.Bold = true;
                    }
                    if (wedstat.Text == "3")
                    {
                        wed.ForeColor = Color.Red;
                        wed.Font.Bold = true;
                    }
                    if (thustat.Text == "3")
                    {
                        thu.ForeColor = Color.Red;
                        thu.Font.Bold = true;
                    }
                    if (fristat.Text == "3")
                    {
                        fri.ForeColor = Color.Red;
                        fri.Font.Bold = true;
                    }
                    if (satstat.Text == "3")
                    {
                        sat.ForeColor = Color.Red;
                        sat.Font.Bold = true;
                    }
                }
}
John
Top achievements
Rank 1
 answered on 03 Oct 2013
2 answers
126 views
I am using a drop down column in my grid. I used a Column Editor to set the width of the drop down used in edit mode. Setting the width works, but...

I want to set the control style of my column to a RadComboBox, but I want the control to use a different skin from the grid. So I set the ComboBoxControl-Skin on the ColumnEditor. 

This doesn't work. I get an error on the page: Object reference not set to an instance of an object.

Is there a way to get this to work? I can use a dropdown list and a form decorator, but it doesn't give me quite the same look.
Rayne
Top achievements
Rank 1
 answered on 03 Oct 2013
1 answer
71 views

How can i assing CssClass to RibbonBarContextualTabGroup? Here is my code.

<style type="text/css">
        .Ctabformat
  {
    font-weight: bold;
    text-decoration: underline;     
  }   
</style>

<ContextualTabGroups>
    <telerik:RibbonBarContextualTabGroup Text="Test" Active="true" CssClass="Ctabformat">
        <telerik:RibbonBarTab Text="Tab1" Font-Bold="true" ></telerik:RibbonBarTab>
    </telerik:RibbonBarContextualTabGroup>
</ContextualTabGroups>

Somehow it is not applying format specified in CssClass.

Kate
Telerik team
 answered on 03 Oct 2013
26 answers
1.9K+ views
Is auto-width supported for the RadComboBox? Is there a way to make it grow horizontally to the largest item in the select list?
Kate
Telerik team
 answered on 03 Oct 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?