Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
110 views
I am trying to validate duplicate value in the Radgrid cell , but it validates same raw itself please help me find the solution.
<asp:CustomValidator ID="CustomValidator1" runat="server" ErrorMessage="Duplicate product not allowed"
                            ControlToValidate="RadComboBox1" OnServerValidate="CustomValidator1_ServerValidate" >
Protected Sub CustomValidator1_ServerValidate(ByVal source As Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs)
            For Each dataItem As GridDataItem In RadGrid1.Items        
            If args.Value = CType(dataItem("pk_productid").FindControl("RadComboBox1"), RadComboBox).Text Then
                args.IsValid = False
            End If
 
        Next
       
    End Sub
 
ZAFFAR
Top achievements
Rank 1
 answered on 05 Mar 2012
1 answer
128 views
Hello, 

I have 2 grids on a .aspx page.  I would like to horizontally scroll both grids from the actual grid control.  Below is the code that I have generated.

The width for each grid is fixed, which creates a problem when user's use a different resolution.  If I use width = 100%, then I lose the horizontal grid scroll bar for each grid.

What I need is to allow for 100% width, but not lose the horizontal scrolling for each grid.

I am binding to Northwind, Contacts and Employee tables.

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        </telerik:RadScriptManager>
        <div style="height: 100%; overflow: auto;">
            <table>
                <tr>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <td>
                <div class="inset" style="padding: 10px; overflow: auto;">
                    <div class="inset-title">Contacts</div>
                        <telerik:RadGrid ID="gridContacts" runat="server" AutoGenerateColumns="False" AllowSorting="False" AllowPaging="False" 
                                                                    PageSize="10" AllowCustomPaging="True" BorderColor="#688CAF" BorderWidth="1px" BorderStyle="Solid" Width="1035px">
                            <ClientSettings EnableRowHoverStyle="True" EnablePostBackOnRowClick="false">
                                <Scrolling FrozenColumnsCount="3" AllowScroll="true" UseStaticHeaders="true" ScrollHeight="" />
                            </ClientSettings>
                            <MasterTableView DataKeyNames="ContactID" CommandItemDisplay="Top" TableLayout="Fixed">
                                <Columns>
                                    <telerik:GridBoundColumn DataField="ContactType" HeaderText="ContactType" UniqueName="ContactType">
                                        <HeaderStyle Wrap="false" Width="120" />
                                        <ItemStyle Wrap="false" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="CompanyName" HeaderText="CompanyName" UniqueName="CompanyName">
                                        <HeaderStyle Wrap="false" Width="100" HorizontalAlign="Left" />
                                        <ItemStyle Wrap="false" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="ContactName" HeaderText="ContactName" UniqueName="ContactName">
                                        <HeaderStyle Wrap="false" Width="80" />
                                        <ItemStyle Wrap="false" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="ContactTitle" HeaderText="ContactTitle" UniqueName="ContactTitle">
                                        <HeaderStyle Wrap="false" Width="100" />
                                        <ItemStyle Wrap="false" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="Address" HeaderText="Address" UniqueName="Address">
                                        <HeaderStyle Wrap="false" Width="100" />
                                        <ItemStyle Wrap="false" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="City" HeaderText="City" UniqueName="City">
                                        <HeaderStyle Wrap="false" Width="100" />
                                        <ItemStyle Wrap="false" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="Region" HeaderText="Region" UniqueName="Region">
                                        <HeaderStyle Wrap="false" Width="100" />
                                        <ItemStyle Wrap="false" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="PostalCode" HeaderText="PostalCode" UniqueName="PostalCode">
                                        <HeaderStyle Wrap="false" Width="100" />
                                        <ItemStyle Wrap="false" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="Phone" HeaderText="Phone" UniqueName="Phone">
                                        <HeaderStyle Wrap="false" Width="100" />
                                        <ItemStyle Wrap="false" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="Extension" HeaderText="Extension" UniqueName="Extension">
                                        <HeaderStyle Wrap="false" Width="150" />
                                        <ItemStyle Wrap="false" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="Fax" HeaderText="Fax" UniqueName="Fax" >
                                        <HeaderStyle Wrap="false" Width="100" />
                                        <ItemStyle Wrap="false" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="HomePage" HeaderText="HomePage" UniqueName="HomePage">
                                        <HeaderStyle Wrap="True" Width="250" />
                                        <ItemStyle Wrap="false" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="PhotoPath" HeaderText="PhotoPath" UniqueName="PhotoPath" >
                                        <HeaderStyle Wrap="false" Width="100" />
                                        <ItemStyle Wrap="false" />
                                    </telerik:GridBoundColumn>
                                </Columns>
                                <NoRecordsTemplate>
                                    <div style="padding: 10px; text-align: center">
                                        No Records to display.</div>
                                </NoRecordsTemplate>
                                <CommandItemTemplate>
                                    <telerik:RadToolBar ID="GridToolbar" runat="server" Width="100%" AutoPostBack="true">
                                        <Items>                                  
                                            <telerik:RadToolBarButton ImageUrl="~/images/icons/document-excel.png" CommandName="ExportToExcel" Text="Export to Excel" />
                                            <telerik:RadToolBarButton ImageUrl="~/images/icons/report.png" CommandName="ExportPropertyValuesReport" Text="Print Report" Enabled="False" />
                                        </Items>
                                    </telerik:RadToolBar>
                                </CommandItemTemplate>
                            </MasterTableView>
                        </telerik:RadGrid>
                </div>
            </td>
                </tr>
            </table>
            <table>
                <tr>
                    <td>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <div class="inset" style="padding: 10px; overflow: auto;">
                    <div class="inset-title">Employees</div>
                        <telerik:RadGrid ID="gridEmployees" runat="server" AutoGenerateColumns="false" AllowSorting="True" AllowPaging="false" BorderColor="#688CAF" BorderWidth="1px" BorderStyle="Solid" Width="1035px">
                            <ClientSettings EnableRowHoverStyle="True" EnablePostBackOnRowClick="false">
                                <Scrolling FrozenColumnsCount="3" AllowScroll="true" ScrollHeight="" UseStaticHeaders="true" />
                            </ClientSettings>
                            <MasterTableView DataKeyNames="EmployeeId" CommandItemDisplay="Top" 
                                GroupLoadMode="Server" TableLayout="Fixed" CommandItemSettings-ShowAddNewRecordButton="False" CommandItemSettings-ShowRefreshButton="False">
                            <Columns>
                                <telerik:GridBoundColumn DataField="LastName" UniqueName="LastName" HeaderText="LastName">
                                    <HeaderStyle Width="150" Wrap="false" />
                                    <ItemStyle Wrap="false" />
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="FirstName" UniqueName="FirstName" HeaderText="FirstName">
                                    <HeaderStyle Width="150" Wrap="false" />
                                    <ItemStyle Wrap="false" />
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="Title" UniqueName="Title" HeaderText="Title">
                                    <HeaderStyle Width="150" Wrap="false" />
                                    <ItemStyle Wrap="false" />
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="TitleOfCourtesy" UniqueName="TitleOfCourtesy" HeaderText="TitleOfCourtesy">
                                    <HeaderStyle Width="200" Wrap="false" />
                                    <ItemStyle Wrap="false" />
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="BirthDate" HeaderText="BirthDate" UniqueName="BirthDate" >
                                    <HeaderStyle Width="90" Wrap="false" />
                                    <ItemStyle HorizontalAlign="Right" Wrap="false" />
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="Address" UniqueName="Address" HeaderText="Address">
                                    <HeaderStyle Width="90" Wrap="false" />
                                    <ItemStyle Wrap="false" />
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="City" UniqueName="City" HeaderText="City">
                                    <HeaderStyle Width="90" Wrap="false" />
                                    <ItemStyle Wrap="false" />
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="Region" UniqueName="Region" HeaderText="Region">
                                    <HeaderStyle Width="90" Wrap="false" />
                                    <ItemStyle HorizontalAlign="Right" Wrap="false" />
                                </telerik:GridBoundColumn>
                                <telerik:GridDateTimeColumn UniqueName="PostalCode" DataField="PostalCode" HeaderText="PostalCode">
                                    <HeaderStyle Wrap="false" Width="100" />
                                    <ItemStyle Wrap="false" />
                                </telerik:GridDateTimeColumn>
                                <telerik:GridDateTimeColumn UniqueName="HomePhone" DataField="HomePhone" HeaderText="HomePhone">
                                    <HeaderStyle Wrap="false" Width="100" />
                                    <ItemStyle Wrap="false" />
                                </telerik:GridDateTimeColumn>
                                <telerik:GridBoundColumn DataField="Extension" UniqueName="Extension" HeaderText="Extension">
                                    <HeaderStyle Width="100" Wrap="false" />
                                    <ItemStyle Wrap="false" />
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="Notes" UniqueName="Notes" HeaderText="Notes">
                                    <HeaderStyle Width="120" Wrap="false" />
                                    <ItemStyle HorizontalAlign="Right" Wrap="false" />
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="ReportsTo" UniqueName="ReportsTo" HeaderText="ReportsTo" DataFormatString="{0:c}">
                                    <HeaderStyle Width="100" Wrap="false" />
                                    <ItemStyle HorizontalAlign="Right" Wrap="false" />
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="PhotoPath" UniqueName="PhotoPath" HeaderText="PhotoPath">
                                    <HeaderStyle Width="110" Wrap="false" />
                                    <ItemStyle Wrap="false" />
                                </telerik:GridBoundColumn>
                            </Columns>
                            <NoRecordsTemplate>
                                <div style="padding: 10px; text-align: center">
                                    No Offers to display.</div>
                            </NoRecordsTemplate>
                            <CommandItemTemplate>
                                <telerik:RadToolBar ID="GridToolbarOffers" runat="server" Width="100%" AutoPostBack="true">
                                    <Items>
                                        <telerik:RadToolBarButton ImageUrl="~/images/icons/document-excel.png" CommandName="ExportToExcel" Text="Export to Excel" />
                                        <telerik:RadToolBarButton ImageUrl="~/images/icons/report.png" CommandName="ExportPropertyValuesReport" Text="Print Report" Enabled="False" />
                                    </Items>
                                </telerik:RadToolBar>
                            </CommandItemTemplate>
                            </MasterTableView>
                        </telerik:RadGrid>
                </div>
                    </td>
                </tr>
            </table>
        </div>
    </form>
</body>
</html>
Tsvetina
Telerik team
 answered on 05 Mar 2012
3 answers
50 views

On the bottom of the http://www.telerik.com/products/whats-new.aspx page, in section 

RadControls for ASP.NET AJAX

there is a grid with text "World Stats" etc.
How can I recreate such layout of the header? Is it simply an added image? If so, to what part of the Grid skin it was added?

Jacek


Tsvetina
Telerik team
 answered on 05 Mar 2012
1 answer
73 views
Hi

I want to apply different style of tool tip. i don't want only a rectangle box.

Regards
Nithya
Shinu
Top achievements
Rank 2
 answered on 05 Mar 2012
1 answer
59 views
Hi

i was not able to set the skin for my tool tip.

Regards
Nithya
Princy
Top achievements
Rank 2
 answered on 05 Mar 2012
1 answer
416 views
I'm trying to add a css class to each RadComboBoxItem in a RadComboBox dunmicaly.

This is not working:
foreach (var status in statuslist)
{
    RadComboBoxItem item = new RadComboBoxItem(status.StockName, status.StockStatusID.ToString());
    item.Attributes.Add("Class", status.StockColor);
    RadComboBox1.Items.Add(item);
}


also tried :
item.CssClass =  status.StockColor;

Neither one uses the css class

any suggestions?

thanks
Princy
Top achievements
Rank 2
 answered on 05 Mar 2012
1 answer
149 views
I'm working with the RadToolBar, and RadToolBarButtons;

My question is how best can I enable rounded corners on the RadToolBarButtons -

EnableRoundedCorners

 

 

="True" is set on the RadToolBar itself;

<telerik:RadToolBar ID="RadToolBar4" Height="30px" runat="server" Width="100%" Skin="Black" OnClientLoad="clientLoad" onbuttonclick="RadToolBar4_ButtonClick" CssClass="SeparatedButtons" OnClientDropDownOpened="dropDownOpened" EnableRoundedCorners="True" >
                             
                <Items>
  
                 <telerik:RadToolBarButton CommandName="Dashboard" Text="Dashboard" ID="rbDashboard" Font-Size="Medium" runat="server" Font-Names="Microsoft Sans Serif" BorderColor="LightGray" BorderStyle="Solid" BorderWidth="1px">
                    </telerik:RadToolBarButton>
              
                    <telerik:RadToolBarButton CommandName="Documents" ID="rbDocuments" runat="server" Text="Documents" Font-Names="Microsoft Sans Serif" Font-Size="Medium" BorderColor="LightGray" BorderStyle="Solid" BorderWidth="1px">
                                </telerik:RadToolBarButton>
  
                     <telerik:RadToolBarButton CommandName="OrgChart" ID="rbOrgChart" runat="server" Text="Organization Chart" Font-Size="Medium" Visible="false" BorderColor="LightGray" BorderStyle="Solid" BorderWidth="1px">
                        </telerik:RadToolBarButton>
                          
                     <telerik:RadToolBarDropDown Text="Please Select" Font-Size="Medium" CssClass="rightAligned" DropDownWidth="220px" BorderColor="White" BorderStyle="Solid" BorderWidth="1px">
                        
                        <Buttons>
                          
                                 <telerik:RadToolBarButton runat="server" Text="Profile" Font-Size="Medium" CheckOnClick="true" CommandName="ViewAccountProfile">
                               </telerik:RadToolBarButton>
  
                                <telerik:RadToolBarButton runat="server" Text="Contact Us" Font-Size="Medium" CheckOnClick="true" CommandName="ContactUs">
                                </telerik:RadToolBarButton>
  
                                <telerik:RadToolBarButton runat="server" Text="Sign Out" Font-Size="Medium" CheckOnClick="true" CommandName="SignOut">
                                </telerik:RadToolBarButton>
  
                                 <%-- <telerik:RadToolBarButton runat="server" Text="Change Password" Font-Size="Medium" CheckOnClick="true" CommandName="ChangePassword">
                                </telerik:RadToolBarButton>--%>
  
                        </Buttons>
                    </telerik:RadToolBarDropDown>
           
                         </Items>
            </telerik:RadToolBar>

 

Princy
Top achievements
Rank 2
 answered on 05 Mar 2012
2 answers
269 views
I have created a custom grid column, so that I can create my own filter control (a combo box).

This was working well, but at some point it stopped working.

After a day of debugging, I've honed in on the problem.

In my case, the field name is "CompanyName", and the user has set the filter value to be "Acme".

The function GridColumn.EvaluateFilterExpression is returning the string:

CompanyName = "Acme".ToUpper()


Obviously, I don't want to convert the string to upper case.

I've overridden the function "EvaluateFilterExpression" as so:

public override string EvaluateFilterExpression(GridFilteringItem filteringItem)
{
    System.Diagnostics.Debug.WriteLine(string.Format("--- GridHyperlinkColumnWithComboFilter.EvaluateFilterExpression({0})", filteringItem));
    var rv = base.EvaluateFilterExpression(filteringItem);
    System.Diagnostics.Debug.WriteLine(string.Format("--- GridHyperlinkColumnWithComboFilter.EvaluateFilterExpression({0}) returning \"{1}\"", filteringItem, rv));
    return rv;
}

And the debug output is:

--- GridHyperlinkColumnWithComboFilter.EvaluateFilterExpression(Telerik.Web.UI.GridFilteringItem)
--- GridHyperlinkColumnWithComboFilter.GetCurrentFilterValueFromControl - returning "Acme"
--- GridHyperlinkColumnWithComboFilter.EvaluateFilterExpression(Telerik.Web.UI.GridFilteringItem) returning "CompanyName = "Acme".ToUpper()"



I've scoured all of the properties of the grid and the column, but can't figure out why "ToUpper" is appearing in the filtering expression.

What would be causing the method "Telerik.Web.UI.GridColumn.EvaluateFilterExpression" to think I want to convert my filter value to upper case?




   
Andrew
Top achievements
Rank 1
Iron
Iron
 answered on 05 Mar 2012
6 answers
208 views
In the radgrid when i want to select the radiobuttonlist in edit mode by selecting the specific row it is not selecting.
Shinu
Top achievements
Rank 2
 answered on 05 Mar 2012
1 answer
107 views
Hi ALL,

I do have a RadGrid with AllowCustomPaging and a CheckBoxList populated on ItemDataBound when user edits a record. 

When user clicks on Update button, NeedDataSource and ItemDataBound events are firing again, so I lose that CheckBoxList selection.

Do you guys have any suggestions?

Thanks,
Shinu
Top achievements
Rank 2
 answered on 05 Mar 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?