Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
201 views
I have this strange problem. I have been using telerik controls for about 1 year now. i used extensively Rad Grid, never had problems.
I am migrating a project from .net 1.1 to 3.5 version. I created a new usercontrol which contains Rad Grid. on hitting Commnad Item "Add new record" which is automatically created. it is hitting initInsert Command, but when i enter the data and press insert or change the data and press update its not hitting item command. I have checked it many times.

 

 

 

 

 

<asp:Panel ID="panel1" runat="server">  
 
<table><tr><td> 
    <telerik:RadGrid ID="RadRelief" runat="server" AllowPaging="True" 
        AllowSorting="True" AutoGenerateColumns="False" GridLines="None"   
        Skin="Outlook" Width="794px" OnItemCommand="RadRelief_ItemCommand" OnInsertCommand="RadRelief_InsertCommand" OnUpdateCommand="RadRelief_UpdateCommand">  
        <PagerStyle NextPageText="&amp;gt;" PrevPageText="&amp;lt;" Mode="NextPrevAndNumeric">  
                </PagerStyle> 
        <MasterTableView CommandItemDisplay="Top" EditMode="InPlace">  
        <NoRecordsTemplate><div>No Records Found.</div></NoRecordsTemplate>  
        <Columns> 
        <telerik:GridTemplateColumn> 
        <EditItemTemplate> 
            <asp:ImageButton ID="ibUpdate" OnClick="ibUpdate_Click" runat="server" CommandName='<%# IIf( DataBinder.Eval(Container, "OwnerTableView.IsItemInserted"), "PerformInsert", "Update")  %>' ImageUrl="~/App_Themes/Operations/images/Icons/accept.gif" /> 
            <asp:ImageButton ID="ibCancel" runat="server" CausesValidation="false" CommandName="Cancel" ImageUrl="~/App_Themes/Operations/images/Icons/cancel.gif" /> 
            </EditItemTemplate> 
            <ItemTemplate> 
            <asp:HiddenField ID="hidvalue" runat="server" Visible="false" Value='<%# Eval("equipmentId") %>' /> 
            <asp:ImageButton ID="ibEdit" runat="server" CommandName="Edit" CausesValidation="false" ImageUrl="~/App_Themes/Operations/images/pencil.gif" /> 
            <asp:ImageButton ID="ibDelete" runat="server" OnClientClick="return PromptDelete();" CausesValidation="false" CommandName="Delete" ImageUrl="~/App_Themes/Operations/images/Icons/delete.gif" /> 
            </ItemTemplate> 
            <HeaderStyle Width="40px" /> 
        </telerik:GridTemplateColumn> 
        <telerik:GridBoundColumn DataField="reliefValveSequence" SortExpression="reliefValveSequence" ReadOnly="true" HeaderText="#">          
        <HeaderStyle Width="10px"></HeaderStyle></telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="reliefValveRunNumber" SortExpression="reliefValveRunNumber" ReadOnly="true" HeaderText="F">  
        <HeaderStyle Width="10px"></HeaderStyle></telerik:GridBoundColumn> 
        <telerik:GridTemplateColumn HeaderText="Set Point PSIG">  
        <ItemTemplate> 
        <asp:Literal ID="lit1" runat="server" Text='<%# Eval("reliefValveSetPointPressure") %>'></asp:Literal> 
        </ItemTemplate> 
        <EditItemTemplate> 
            <asp:TextBox ID="txtReliefValveSetPointPressure" runat="server" Text='<%# Eval("reliefValveSetPointPressure") %>'></asp:TextBox> 
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="txtReliefValveSetPointPressure" runat="server" ErrorMessage="*Required">*</asp:RequiredFieldValidator> 
        </EditItemTemplate> 
        </telerik:GridTemplateColumn> 
          <telerik:GridTemplateColumn HeaderText="Conn. Pipe I.D.">  
       <ItemTemplate> 
        <asp:Literal ID="lit2" runat="server" Text='<%# Eval("connectingPipeInternalDiameter") %>'></asp:Literal> 
        </ItemTemplate> 
        <EditItemTemplate> 
            <asp:TextBox ID="txtConnectingPipeInternalDiameter" runat="server" Text='<%# Eval("connectingPipeInternalDiameter") %>'></asp:TextBox> 
            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" ControlToValidate="txtConnectingPipeInternalDiameter" runat="server" ErrorMessage="*Required">*</asp:RequiredFieldValidator> 
        </EditItemTemplate> 
        </telerik:GridTemplateColumn> 
          <telerik:GridTemplateColumn HeaderText="Type">  
         <ItemTemplate> 
        <asp:Literal ID="lit3" runat="server" Text='<%# Eval("coeffTypeCode") %>'></asp:Literal> 
        </ItemTemplate> 
        <EditItemTemplate> 
            <asp:TextBox ID="txtCoeffTypeCode" Width="65px" runat="server" Text='<%# Eval("coeffTypeCode") %>'></asp:TextBox> 
            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" ControlToValidate="txtCoeffTypeCode" runat="server" ErrorMessage="*Required">*</asp:RequiredFieldValidator> 
        </EditItemTemplate> 
        <HeaderStyle Width="70px" /> 
        </telerik:GridTemplateColumn> 
          <telerik:GridTemplateColumn HeaderText="Size">  
        <ItemTemplate> 
        <asp:Literal ID="lit4" runat="server" Text='<%# Eval("coeffSize") %>'></asp:Literal> 
        </ItemTemplate> 
        <EditItemTemplate> 
            <asp:TextBox ID="txtCoeffSize" Width="65px" runat="server" Text='<%# Eval("coeffSize") %>'></asp:TextBox> 
            <asp:RequiredFieldValidator ID="RequiredFieldValidator4" ControlToValidate="txtCoeffSize" runat="server" ErrorMessage="*Required">*</asp:RequiredFieldValidator> 
        </EditItemTemplate> 
        <HeaderStyle Width="70px" /> 
        </telerik:GridTemplateColumn> 
          <telerik:GridTemplateColumn HeaderText="Description">  
       <ItemTemplate> 
        <asp:Literal ID="lit5" runat="server" Text='<%# Eval("coeffDesc") %>'></asp:Literal> 
        </ItemTemplate> 
        <EditItemTemplate> 
            <asp:TextBox ID="txtCoeffDesc" runat="server" Text='<%# Eval("coeffDesc") %>'></asp:TextBox> 
        </EditItemTemplate> 
        </telerik:GridTemplateColumn> 
        <telerik:GridTemplateColumn HeaderText="Additional Info.">  
       <ItemTemplate> 
            <asp:Literal ID="lit6" runat="server" Text='<%# Eval("reliefValveDesc") %>'></asp:Literal> 
        </ItemTemplate> 
        <EditItemTemplate> 
            <asp:TextBox ID="txtreliefValveDesc" runat="server" Text='<%# Eval("reliefValveDesc") %>'></asp:TextBox> 
        </EditItemTemplate> 
        </telerik:GridTemplateColumn> 
        </Columns> 
            <RowIndicatorColumn> 
                <HeaderStyle Width="20px" /> 
            </RowIndicatorColumn> 
            <ExpandCollapseColumn> 
                <HeaderStyle Width="20px" /> 
            </ExpandCollapseColumn> 
        </MasterTableView> 
    </telerik:RadGrid> 
</td></tr></table> 
    <asp:ValidationSummary ID="ValidationSummary1" runat="server" /> 
</asp:Panel> 

 VB

Partial Public Class ReliefValueDE  
    Inherits System.Web.UI.UserControl  
    Protected WithEvents DataSet11 As MARRS.DataSet1  
    Private intCut As Int16 = 1  
    Protected WithEvents ibSelect As ImageButton  
 
    Protected Sub Page_Load(ByVal sender As ObjectByVal e As System.EventArgs) Handles Me.Load  
        DataSet11 = Session("DataSet11")  
    End Sub 
 
    Protected Sub FillGrid()  
        If intCut = 1 Then 
            FillReliefData("U")  
        Else 
            FillReliefData("D")  
        End If 
        RadRelief.DataSource = DataSet11.Tables("dbo.up_GetReliefValveByAssemblyId")  
    End Sub 
 
    Protected Sub FillReliefData(ByVal positionCode As String)  
        Dim myConnection As SqlConnection = New SqlConnection(MarrsDb.ConnectionString)  
        Dim myCommand As SqlCommand = New SqlCommand("up_GetReliefValveByAssemblyId", myConnection)  
        myCommand.CommandType = CommandType.StoredProcedure  
        Dim workParam As SqlParameter  
        workParam = New SqlParameter("@assemblyId", SqlDbType.Int)  
        workParam.Direction = ParameterDirection.Input  
        workParam.Value = DataSet11.GeneralInfo(0).AssemblyId  
        myCommand.Parameters.Clear()  
        myCommand.Parameters.Add(workParam)  
 
        workParam = New SqlParameter("@positionCode", SqlDbType.Text)  
        workParam.Direction = ParameterDirection.Input  
        workParam.Value = positionCode  
        myCommand.Parameters.Add(workParam)  
        myConnection.Open()  
 
        Dim DA As SqlDataAdapter = New SqlDataAdapter(myCommand)  
        DA.Fill(DataSet11)  
    End Sub 
 
    Protected Sub RadRelief_NeedDataSource(ByVal source As ObjectByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadRelief.NeedDataSource  
        FillGrid()  
    End Sub 
 
    Protected Sub RadRelief_ItemCommand(ByVal source As ObjectByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadRelief.ItemCommand  
        If (e.CommandName = "Edit"Then 
 
        End If 
    End Sub 
    Public Property _CutNumber() As Int16  
        Get 
            Return intCut  
        End Get 
        Set(ByVal Value As Int16)  
            intCut = Value  
        End Set 
    End Property 
    Public Sub _SetDataSet(ByRef Value As DataSet1)  
        Me.DataSet11 = Value  
    End Sub 
 
    Protected Sub RadRelief_InsertCommand(ByVal source As ObjectByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadRelief.InsertCommand  
 
    End Sub 
 
    Protected Sub RadRelief_UpdateCommand(ByVal source As ObjectByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadRelief.UpdateCommand  
 
    End Sub 
 
    Protected Sub ibUpdate_Click(ByVal sender As ObjectByVal e As EventArgs)  
 
    End Sub 
End Class 

 

 

 

 

 

 

 

 

There is no code as of now. but i am not able to hit the break points on command events to go forward.
Any help would be appreciated. 
Thanks

 

 

 

 

Vlad
Telerik team
 answered on 18 Aug 2009
0 answers
45 views
Hi,

I need to enter event like 1st,3rd and 5th weekend (if there is 5) in a month using recurring feature. Weekend will include friday,saturday,sunday.How is it possible? please let me know the recurrence rule for this..
Also how to enter events for odd and even years??

Thanks
Rajesh
rajesh
Top achievements
Rank 1
 asked on 18 Aug 2009
1 answer
129 views
I noticed in the validation example found here:
http://demos.telerik.com/aspnet-ajax/calendar/examples/datepicker/validation/defaultcs.aspx

That the display is different in IE6 vs firefox 3.0

The following steps illustrate the point
1. Use the picker to choose a valid date.
2. Edit the date in the field so that the year has 5 digits
3. remove focus form the field
The result is that in firefox, the entered data is read, a read border appears around the input field, an error icon is displayed within the field and an error message is shown. If IE, the only thing shown is the error message. Is there away to get these to behaving consistently? The firefox option is my preferred display.

Thanks
Iana Tsolova
Telerik team
 answered on 18 Aug 2009
4 answers
226 views
I'm sorry but I just can't get my head around what Telerik is trying to do to the world.  I just tried the Visual Skinning tool and, though it looks flashy, ... what's this all about?

Look:
I don't want to create "custom skins" for anything. I want the code that telerik generated to simply BE VOID OF STYLING. Nothing. Rien. Nada .. and whatever.

I want it to have NO BUILT-IN CLASSES, NO INLINE STYLES.  I want it to know exactly what its supposed to look like by having it react to the CSS that already exists on its page. I want telerik grids to look JUST LIKE the non-telerik grids on the rest of the website.

I thought / hoped we were rid of the pre-thunked (as in thinked) "we know better than you" nonsense that plagues microsoft controls (gridview, formview, etc).  But no we see Telerik has taken this mad idea to a whole new level ..

the gods of the internet bless MVC .. and death to blobbous unbeliveably overcomplex self-styling non-confirming controls.

Its only because my company is forcing me to use telerik that, unfortunately, I continue to use telerik.


Dimo
Telerik team
 answered on 18 Aug 2009
2 answers
188 views
I have a RadAjaxManager wired up to a button control that upates an asp:panel. Ignored meaning that the postback occurs and the button click event handler fires, but the page isn't uploaded. This is inside a user control that is hosted inside an aspx page. The ajax settings are set inside the usercontrol itself.

What's even wierder is that the loading panel displays. It just won't update the panel.
rh
Top achievements
Rank 1
 answered on 18 Aug 2009
5 answers
228 views
I'm new do telerik-rad-controls and using your examples for learning. Following your "Input" expl. I get an "Error Rendering Control" when ever I add an label to a RadMaskedTextBox, RadNumericText etc. That's the case, even if I open your example code. However, the Label are shown OK on the web-pages when viewed by browser.
I have RadControls for Ajax 2008_Q2, VS2008 SP1, NET 3.5.
What's to do?
PMM

Iana Tsolova
Telerik team
 answered on 18 Aug 2009
3 answers
794 views
Hi,

I have grid with filtering enabled. Filtering seems to be working well except when I use '>' or '<' chars in filter box.

When I type for example "> 50%" and select "contains" from the menu it returns all the rows in datasource. It seems that  RadGrid.MasterTableView.FilterExpression is allways empty when using less than or greater than signs.

Also when I try to access the filter textbox on server-side(see below) it's empty when using those chars.
            GridFilteringItem filterItem = (GridFilteringItem)grid1.MasterTableView.GetItems(GridItemType.FilteringItem)[0]; 
            TextBox txtFilter = (TextBox)filterItem["answer"].Controls[0]; 
            string searchFor = txtFilter.Text; 



However the filter value is available in __EVENTARGUMENT hidden field.
  • FireCommand:grid1$ctl00;Filter;answer|> 50%|Contains


So my question is:
Why FilterExpression is empty and how can easily fix filtering with less than and greater than signs?




By the way.. Using single apostrophe causes filtering not to work and javascript error because string is not escaped in postback function.
__doPostBack('grid1','FireCommand:grid1$ctl00;Filter;answer|abc's|Contains') 


I'm using version 2008.2.826.35.


Regards,
Arsi
Mira
Telerik team
 answered on 18 Aug 2009
2 answers
135 views
I have a three-tiered hierarchical grid.  I am trying to use the Window / Edit Dialog for Grid example to insert / edit records.  The example works fine for a single-tier grid, but I can't follow what I need to do to edit the command item template and the template columns at the higher levels.

I'll apologize up front.  This is my first attempt at using a hierarchical grid and I'm finding the documentation and examples very confusing and/or sparse.

My three tiers are:
  DeviceClass
    DeviceGroup
      Devices

For example, the CommandItemTemplate at the first level looks like:
<CommandItemTemplate> 
  <href="#" onclick="return ShowClassInsert();">Add new Device Class</a> 
</CommandItemTemplate> 
and the template column contains
<telerik:GridTemplateColumn UniqueName="EditClass">  
  <ItemTemplate> 
    <asp:HyperLink ID="EditClassLink" runat="server" Text="Edit" /> 
  </ItemTemplate> 
</telerik:GridTemplateColumn> 
 
In the code-behind, I have
Protected Sub gridDevices_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles gridDevices.ItemCreated  
 
        If TypeOf e.Item Is GridDataItem Then  
 
            Dim editClass As HyperLink = DirectCast(e.Item.FindControl("EditClassLink"), HyperLink)  
            If Not (editClass Is Nothing) Then  
                editClass.Attributes("href") = "#"  
                editClass.Attributes("onclick") = String.Format("return ShowClassEdit('{0}','{1}');", _  
                 e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("DeviceClass"), _  
                 e.Item.ItemIndex)  
            End If  
 
        End If  
    End Sub 

This works just fine and opens the window like it should - but only for the first tier. 

What I need now is that when I click on the 'Add new Group' command at the top of the grid, I need to be able to pass the key of the parent DeviceClass, and when I click on the Edit command in the grid for a DeviceGroup, to pass both the parent DeviceClass and the current DeviceGroup.  For the 'Add...' I want the onclick code to look like 'return ShowGroupInsert('parentClass');' and on the template column, I need for the onclick to look like 'return ShowGroupEdit('parentClass','selectedGroup');'

To take this to the third level, it would be the same except for the 'Add...' I want the onclick code to look like 'return ShowDeviceInsert('parentClass','parentGroup');' and on the template column, I need for the onclick to look like 'return ShowGroupEdit('parentClass','parentGroup','parentType');'.

I have included all of my code thus far below if you need it for reference.

Many thanks!
Steve

Here is all of my aspx code. 
<%@ Page Title="" Language="VB" MasterPageFile="~/CTMNet.master" AutoEventWireup="false" CodeFile="devs.aspx.vb" Inherits="devs" %> 
 
<asp:Content ID="Content1" ContentPlaceHolderID="cphHead" Runat="Server">  
</asp:Content> 
<asp:Content ID="Content2" ContentPlaceHolderID="cphBody" Runat="Server">  
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">  
        <script type="text/javascript">  
            function ShowClassEdit(dc, rowIndex) {  
                var grid = $find("<%= gridDevices.ClientID %>");  
                var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element();  
                grid.get_masterTableView().selectItem(rowControl, true);  
                window.radopen("EditDeviceClass.aspx?dc=" + dc, "DeviceClassDialog");  
                return false;  
            }  
 
            function ShowClassInsert() {  
                window.radopen("EditDeviceClass.aspx?dc=new", "DeviceClassDialog");  
                return false;  
            }  
 
            function ShowGroupEdit(dc, dg, rowIndex) {  
                var grid = $find("<%# gridDevices.ClientID %>");  
                var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element();  
                grid.get_masterTableView().selectItem(rowControl, true);  
                window.radopen("EditDeviceGroup.aspx?dc=" + dc + "&dg=" + dg, "DeviceClassDialog");  
                return false;  
            }  
 
            function ShowGroupInsert(dc, rowIndex) {  
                window.radopen("EditDeviceGroup.aspx?dc=" + dc + "&dg=new", "DeviceClassDialog");  
            }  
 
            function ShowDeviceEdit(dc, dg, dt, rowIndex) {  
                var grid = $find("<%# gridDevices.ClientID %>");  
                var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element();  
                grid.get_masterTableView().selectItem(rowControl, true);  
                window.radopen("EditDevice.aspx?dc=" + dc + "&dg=" + dg + "&typ=" + dt, "DeviceClassDialog");  
                return false;  
            }  
 
            function ShowDeviceInsert(dc, dg, rowIndex) {  
                window.radopen("EditDevice.aspx?dc=" + dc + "&dg=" + dg + "&typ=new", "DeviceClassDialog");  
            }  
 
            function refreshGrid(arg) {  
                if (!arg) {  
                    $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");  
                }  
                else {  
                    $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("RebindAndNavigate");  
                }  
            }  
        </script> 
    </telerik:RadCodeBlock> 
    <h3>Device Maintenance</h3> 
    <telerik:RadGrid ID="gridDevices" runat="server" AutoGenerateColumns="False"   
        ShowStatusBar="True" GridLines="None" DataSourceID="dsClasses">  
        <MasterTableView DataKeyNames="DeviceClass" Width="100%" CommandItemDisplay="Top" DataSourceID="dsClasses" Name="DeviceClass">  
            <DetailTables> 
                <telerik:GridTableView DataKeyNames="DeviceClass, DeviceGroup" DataSourceID="dsGroups" Name="DeviceGroups"   
                    Width="100%" runat="server" CommandItemDisplay="Top" BorderColor="#800000" BorderWidth="3px">  
                    <ParentTableRelation> 
                        <telerik:GridRelationFields DetailKeyField="DeviceClass" MasterKeyField="DeviceClass" /> 
                    </ParentTableRelation> 
                    <DetailTables> 
                        <telerik:GridTableView DataKeyNames="DeviceClass, DeviceGroup, DeviceType" DataSourceID="dsDevices"   
                            Name="Devices" width="100%" runat="server" CommandItemDisplay="Top" BorderColor="#008000" BorderWidth="3px">  
                            <ParentTableRelation> 
                                <telerik:GridRelationFields DetailKeyField="DeviceClass" MasterKeyField="DeviceClass" /> 
                                <telerik:GridRelationFields DetailKeyField="DeviceGroup" MasterKeyField="DeviceGroup" /> 
                            </ParentTableRelation> 
                            <Columns> 
                                <telerik:GridBoundColumn DataField="DeviceNum" HeaderText="Device" MaxLength="7" UniqueName="DeviceNum" /> 
                                <telerik:GridBoundColumn DataField="DeviceDescription" HeaderText="Description"   
                                    MaxLength="70" UniqueName="DeviceDescription" /> 
                                <telerik:GridCheckBoxColumn DataField="Active" HeaderText="Active" UniqueName="Active"   
                                    ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" /> 
                                <telerik:GridBoundColumn DataField="CostingType" HeaderText="Costing Tab" MaxLength="50" 
                                    UniqueName="CostingType" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" /> 
                                <telerik:GridNumericColumn DataField="DirectCosts" HeaderText="Direct Costs" DataFormatString="{0:c}" 
                                    UniqueName="DirectCosts" ItemStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Right" /> 
                                <telerik:GridNumericColumn DataField="OptionsDirect" HeaderText="Direct Options" 
                                    DataFormatString="{0:c}" UniqueName="OptionsDirect" ItemStyle-HorizontalAlign="Right" 
                                    HeaderStyle-HorizontalAlign="Right" /> 
                                <telerik:GridDateTimeColumn DataField="ModifiedOn" HeaderText="Last Updated On" UniqueName="ModifiedOn" /> 
                                <telerik:GridBoundColumn DataField="ModifiedBy" HeaderText="Last Updated By"   
                                    MaxLength="30" UniqueName="ModifiedBy" />   
                                <telerik:GridTemplateColumn UniqueName="EditDevice">  
                                    <ItemTemplate> 
                                        <asp:HyperLink ID="EditDevice" runat="server" Text="Edit" /> 
                                    </ItemTemplate> 
                                </telerik:GridTemplateColumn> 
                            </Columns> 
                            <CommandItemTemplate> 
                                <href="#" onclick="return ShowDeviceInsert();">Add new Device</a> 
                            </CommandItemTemplate> 
                        </telerik:GridTableView> 
                    </DetailTables> 
                    <ExpandCollapseColumn Visible="true" /> 
                    <Columns> 
                        <telerik:GridBoundColumn DataField="DeviceGroup" HeaderText="Device Group" MaxLength="2" UniqueName="DeviceGroup" /> 
                        <telerik:GridBoundColumn DataField="GroupDescription" HeaderText="Group Description"   
                            MaxLength="30" UniqueName="GroupDescription" /> 
                        <telerik:GridTemplateColumn UniqueName="EditGroup">  
                            <ItemTemplate> 
                                <asp:HyperLink ID="EditGroup" runat="server" Text="Edit" /> 
                            </ItemTemplate> 
                        </telerik:GridTemplateColumn> 
                    </Columns> 
                    <CommandItemTemplate> 
                        <href="#" onclick="return ShowGroupInsert();">Add new Device Group</a> 
                    </CommandItemTemplate> 
                </telerik:GridTableView> 
            </DetailTables> 
            <ExpandCollapseColumn Visible="true" /> 
            <Columns> 
                <telerik:GridBoundColumn DataField="DeviceClass" HeaderText="Class" MaxLength="2" UniqueName="DeviceClass" /> 
                <telerik:GridBoundColumn DataField="ClassDescription" HeaderText="Description" MaxLength="30" UniqueName="ClassDescription" /> 
                <telerik:GridNumericColumn DataField="LaborRate" HeaderText="Labor Rate" MaxLength="7" DataFormatString="{0:c}" UniqueName="LaborRate" Visible="true" /> 
                <telerik:GridTemplateColumn UniqueName="EditClass">  
                    <ItemTemplate> 
                        <asp:HyperLink ID="EditClassLink" runat="server" Text="Edit" /> 
                    </ItemTemplate> 
                </telerik:GridTemplateColumn> 
            </Columns> 
            <CommandItemTemplate> 
                <href="#" onclick="return ShowClassInsert();">Add new Device Class</a> 
            </CommandItemTemplate> 
        </MasterTableView> 
    </telerik:RadGrid> 
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default" /> 
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server">  
        <Windows> 
            <telerik:RadWindow ID="DeviceClassDialog" runat="server" Title="Device Class Maintenance" Height="400px" Width="300px" Left="150px" 
                ReloadOnShow="true" ShowContentDuringLoad="false" Modal="true" /> 
        </Windows> 
    </telerik:RadWindowManager> 
    <asp:SqlDataSource ID="dsClasses" runat="server" ConnectionString="<%$ ConnectionStrings:MM %>" 
        ProviderName="System.Data.SqlClient" SelectCommand="select DeviceClass, ClassDescription, LaborRate from tblCBO_DeviceClass" /> 
    <asp:SqlDataSource ID="dsGroups" runat="server" ConnectionString="<%$ ConnectionStrings:MM %>" 
        ProviderName="System.Data.SqlClient" SelectCommand="select DeviceClass, DeviceGroup, DeviceClassGroup, GroupDescription from tblCBO_DeviceGroup where DeviceClass = @DeviceClass">  
        <SelectParameters> 
            <asp:SessionParameter Name="DeviceClass" SessionField="DeviceClass" Type="String" /> 
        </SelectParameters> 
    </asp:SqlDataSource> 
    <asp:SqlDataSource ID="dsDevices" runat="server" ConnectionString="<%$ ConnectionStrings:MM %>" 
        ProviderName="System.Data.SqlClient" SelectCommand="select DeviceNum, DeviceDescription, isnull(Active,0) as Active, CostingType, isnull(DirectCosts,0) as DirectCosts, isnull(OptionsDirect,0) as OptionsDirect, DeviceClass, DeviceGroup, DeviceType, ModifiedBy, ModifiedOn from tblDevices where DeviceClass = @DeviceClass and DeviceGroup = @DeviceGroup">  
        <SelectParameters> 
            <asp:SessionParameter Name="DeviceClass" SessionField="DeviceClass" Type="String" /> 
            <asp:SessionParameter Name="DeviceGroup" SessionField="DeviceGroup" Type="String" /> 
        </SelectParameters> 
    </asp:SqlDataSource> 
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
    </telerik:RadAjaxManager> 
</asp:Content> 
 
 
Likewise, here is my entire code-behind as well:
Imports System.Data  
Imports System.Data.SqlClient  
Imports Telerik.Web.UI  
 
Partial Class devs  
    Inherits System.Web.UI.Page  
 
    Protected Sub gridDevices_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles gridDevices.ItemCreated  
 
        If TypeOf e.Item Is GridDataItem Then  
 
            Dim editClass As HyperLink = DirectCast(e.Item.FindControl("EditClassLink"), HyperLink)  
            If Not (editClass Is Nothing) Then  
                editClass.Attributes("href") = "#"  
                editClass.Attributes("onclick") = String.Format("return ShowClassEdit('{0}','{1}');", _  
                 e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("DeviceClass"), _  
                 e.Item.ItemIndex)  
            End If  
 
        End If  
    End Sub  
 
    Protected Sub RadAjaxManager1_AjaxRequest(ByVal sender As Object, ByVal e As Telerik.Web.UI.AjaxRequestEventArgs) Handles RadAjaxManager1.AjaxRequest  
 
        Select Case e.Argument  
            Case "Rebind"  
                gridDevices.MasterTableView.SortExpressions.Clear()  
                gridDevices.MasterTableView.GroupByExpressions.Clear()  
                gridDevices.Rebind()  
            Case "RebindAndNavigate"  
                gridDevices.MasterTableView.SortExpressions.Clear()  
                gridDevices.MasterTableView.GroupByExpressions.Clear()  
                gridDevicesgridDevices.MasterTableView.CurrentPageIndex = gridDevices.MasterTableView.PageCount - 1  
                gridDevices.Rebind()  
        End Select  
 
    End Sub  
End Class  
 

Steve LaForge
Top achievements
Rank 1
 answered on 18 Aug 2009
3 answers
156 views
Hiya ... I seem to have the opposite issue of many in the searches I did on Grid and Width and Scrolling. Most seem to get the Browser horizontal scroll bar and want the grid to scroll not the page. With our last release we'd set our page to be a fixed width, and added a div around the Grids so that the grids could be scrolled independent of the page itself. Users are clamoring to have it back to the old way. Unfortunately, with our last release I also updated the control suite to the ASP .NET AJAX as well, and now when I remove the div we placed to scroll the grid, the page scroll does not appear.

Instead, the grid takes up as much of the screen as is available, but the times when the width of the populated columns is greater than the page width, the grid border ends, the data columns extend off the page, but no browser horizontal scroll bar appears.

Help? :)

RadControls for ASPNET AJAX Q1 2009
Microsoft Internet Explorer 7.x

Below is the grid aspx ... I've tried setting both the full RadGrid and the MasterTableView and both to 100% and no change.

<telerik:RadGrid ID="RadGrid1" runat="server" Skin="Office2007" 
    OnNeedDataSource="RadGrid1_NeedDataSource" AllowSorting="True"   
    EnableAJAX="True" EnableAJAXLoadingTemplate="True"  AllowMultiRowSelection="true" 
    LoadingTemplateTransparency="25" AllowPaging="false"   
    onitemcommand="RadGrid1_ItemCommand" GridLines="None"   
    onitemcreated="RadGrid1_ItemCreated" ShowFooter="True">  
    <PagerStyle AlwaysVisible="True" Mode="NextPrevAndNumeric" Position="Top" HorizontalAlign="Left" /> 
    <MasterTableView CommandItemDisplay="None" > 
        <ExpandCollapseColumn Visible="False" Resizable="False">  
            <HeaderStyle Width="20px" /> 
        </ExpandCollapseColumn> 
        <RowIndicatorColumn Visible="False">  
            <HeaderStyle Width="20px" /> 
        </RowIndicatorColumn> 
        <Columns> 
            <telerik:GridClientSelectColumn UniqueName="SelectCheckbox" /> 
        </Columns> 
        <CommandItemTemplate> 
            <div id="my_command_template">  
                <asp:LinkButton ID="LinkButton_exportToExcel" runat="server"  CommandName="ExportToExcel" ToolTip="Export to Excel"></asp:LinkButton> <asp:CheckBox ID="CheckBox_ignorePaging" Checked="true" runat="server" Text="... include data on all pages." />   
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<asp:LinkButton ID="LinkButton_excludedAssets" runat="server" CommandName="ExcludedAssetsShow"></asp:LinkButton> 
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<asp:LinkButton ID="LinkButton_exportToExcel_mass" runat="server"  CommandName="ExportToExcel_mass" ></asp:LinkButton>   
            </div> 
        </CommandItemTemplate> 
    </MasterTableView> 
        <HeaderContextMenu EnableTheming="True" Skin="Office2007">  
            <CollapseAnimation Duration="200" Type="OutQuint" /> 
        </HeaderContextMenu> 
    <AlternatingItemStyle BackColor="FloralWhite" /> 
        <ClientSettings> 
            <Selecting AllowRowSelect="True" /> 
        </ClientSettings> 
        <FilterMenu EnableTheming="True" Skin="Office2007">  
            <CollapseAnimation Duration="200" Type="OutQuint" /> 
        </FilterMenu> 
</telerik:RadGrid> 
Dimo
Telerik team
 answered on 18 Aug 2009
3 answers
251 views

This is not working for me:

 

 

<HeaderStyle HorizontalAlign="Left" />

I want to left-align the day header labels (S, M, T, W, etc.). I think the above should override the values set in any skin shouldn't it?

Thank you

 

Dimo
Telerik team
 answered on 18 Aug 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
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
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?