Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
137 views
Hi - I am very excited to use the RadTreeList as it will greatly simplify some existing code I created using RadGrid -- can you point me to a reference for Server Events (like Item DataBound) where I might be able to manipulate items? Documentation does not show server events..

Ford
Iana Tsolova
Telerik team
 answered on 12 Nov 2010
1 answer
510 views
Heyas;

I thought I had a fairly straight forward thing going on, but it seems I'm stumbling over syntax.  I am hoping someone can quickly clue me in so I can get this page knocked out.  Basically, I have a grid with a heirarchy.  In the detail view, there's a button that fires the "Select" command.  When that happens, I need to get 2-3 data values from the selected record in the detail, and pass them to a variable for the next step.  I know the code needs to go in the ItemCommand event, but I'm not sure on the syntax.  Most of what I'm trying hasn't really met with much success, and I think it is because I am a little confused how the "bubble up" works when it comes to implementation.

Here's the relevant ASPX code:
<telerik:RadGrid ID="CreditsGrid" runat="server"
    AllowPaging="True"
    AllowSorting="True"
    DataSourceID="SqlDataSource1"
    GridLines="None" AutoGenerateColumns="False">
     
    <MasterTableView
        DataSourceID="SqlDataSource1"
        DataKeyNames="OrderID">
        <DetailTables>
            <telerik:GridTableView runat="server"
                DataSourceID="SqlDataSource2"
                DataKeyNames="OrderID">
            <ParentTableRelation>
                <telerik:GridRelationFields
                    MasterKeyField="OrderID"
                    DetailKeyField="OrderID" />
            </ParentTableRelation>
                <CommandItemSettings ExportToPdfText="Export to Pdf" />
            <Columns>                            
                <telerik:GridBoundColumn
                    DataField="DateCreated"
                    HeaderText="Date Created"
                    SortExpression="DateCreated"
                    UniqueName="DateCreated"
                    ReadOnly="True" />
                <telerik:GridBoundColumn
                    DataField="EnteredBy"
                    HeaderText="Entered By"
                    SortExpression="EnteredBy"
                    UniqueName="EnteredBy"
                    ReadOnly="True" />
                <telerik:GridBoundColumn
                    DataField="ChargeCode"
                    HeaderText="Reason Code"
                    SortExpression="ChargeCode"
                    UniqueName="ChargeCode"
                    ReadOnly="True" />                                   
                <telerik:GridBoundColumn
                    DataField="Description"
                    HeaderText="Description"
                    SortExpression="Description"
                    UniqueName="Description"
                    ReadOnly="True" />
                <telerik:GridButtonColumn
                    Text="Review Transaction"
                    ButtonType="LinkButton"
                    CommandName="Select"
                    UniqueName="btnRevTrans" />                                                                           
            </Columns>
            </telerik:GridTableView>
        </DetailTables>                   
        <RowIndicatorColumn>
            <HeaderStyle Width="20px" />
        </RowIndicatorColumn>
        <CommandItemSettings ExportToPdfText="Export to Pdf" />
        <ExpandCollapseColumn>
            <HeaderStyle Width="20px" />
        </ExpandCollapseColumn>
        <Columns>
            <telerik:GridBoundColumn
                DataField="DateCreated"
                DataType="System.DateTime"
                HeaderText="Date Created"
                SortExpression="DateCreated"
                UniqueName="DateCreated">
                <HeaderStyle Width="175px" />
                <ItemStyle Width="175px" />
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn
                DataField="OrderID"
                DataType="System.Int32"
                HeaderText="OrderID"
                SortExpression="OrderID"
                UniqueName="OrderID">
                <HeaderStyle Width="200px" />
                <ItemStyle Width="200px" />
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn
                DataField="NumOfOrders"
                DataType="System.Int32"
                HeaderText="# of Orders"
                ReadOnly="True"
                SortExpression="NumOfOrders"
                UniqueName="NumOfOrders">
            </telerik:GridBoundColumn>
            <telerik:GridButtonColumn
                CommandName="Select"
                DataTextField="OrderID"
                Text="View"
                UniqueName="column">
            </telerik:GridButtonColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

And following area my feeble attempts on the vb.net side (I know the code is incomplete)
Private Sub CreditsGrid_ItemCommand(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles CreditsGrid.ItemCommand
 
    If e.CommandName = "Select" Then
 
        'Put selected values to variables
        Dim OrderID = CreditsGrid.MasterTableView.GetSelectedItems("OrderID")
        Dim CreatedDate = CreditsGrid.MasterTableView.GetSelectedItems("CreatedDate")
 
        'Removes session variables (just to be safe) & replaces with the new variables.
        Session.Remove("OrderID")
        Session.Remove("CreatedDate")
        Session.Add("OrderID", OrderID)
        Session.Add("CreatedDate", CreatedDate)
 
        'Load Review form.
        CreditsWindow.VisibleOnPageLoad = True
 
    End If
End Sub

Obviously, this doesn't work so well.  Can someone give me a pointer in the right direction?
TSCGlobal
Top achievements
Rank 1
 answered on 12 Nov 2010
1 answer
83 views
I'm looking to be able to handle the reorder myself in the server side RowDrop event using a post drag reordered list. I'll loop thru myself and reorder my data. Is that possible?

<telerik:RadGrid
    ID="gridQL"
    runat="server"
    AutoGenerateColumns="false"
    OnItemCommand="RadGrid_ItemCommand"
    Height="300"
    OnItemDataBound="RadGrid_ItemDataBound"
    OnRowDrop="grdPendingOrders_RowDrop">
    <MasterTableView DataKeyNames="HomeQuickLinkID">
        <Columns>
            <telerik:GridBoundColumn DataField="HomeQuickLinkID" Display="false"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="LinkTitle" HeaderText="Link Title"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="LongShowDate" HeaderText="Show Date"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="LongUpdatedDate" HeaderText="Last Updated"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="UpdatedName" HeaderText="Last Updated By"></telerik:GridBoundColumn>
            <telerik:GridButtonColumn ButtonType="LinkButton" Text="Move Up" CommandName="UpQL"><ItemStyle Width="50px"></ItemStyle></telerik:GridButtonColumn>
            <telerik:GridButtonColumn ButtonType="LinkButton" Text="Move Down" CommandName="DownQL"><ItemStyle Width="70px"></ItemStyle></telerik:GridButtonColumn>
            <telerik:GridButtonColumn ButtonType="LinkButton" Text="Edit" CommandName="EditQL"></telerik:GridButtonColumn>
            <telerik:GridButtonColumn ButtonType="LinkButton" Text="Delete" CommandName="DeleteQL"></telerik:GridButtonColumn>
        </Columns>
    </MasterTableView>
    <ClientSettings EnablePostBackOnRowClick="true"  AllowRowsDragDrop="True">
        <Selecting AllowRowSelect="True" UseClientSelectColumnOnly="true"/>
    </ClientSettings>
</telerik:RadGrid>

protected void grdPendingOrders_RowDrop(object sender, GridDragDropEventArgs e)
    {
        int o = 0;
        NextGen.core.CMS.HomeQuickLinkManager m = new NextGen.core.CMS.HomeQuickLinkManager();
        foreach (GridDataItem i in e.[ReorderedItemsLists])
        {
            o = o + 1;
            m.EditOrder((int)draggedItem.GetDataKeyValue("HomeQuickLinkID"), o);           
        }
        LoadGrid();
    }
Tsvetina
Telerik team
 answered on 12 Nov 2010
0 answers
47 views
I have created a custom control  similar to product control and  customized the look of ItemList page  with repeater control in ContentViewItemList.ascx .

I have added paging at the bottom of the page  with code below. With that paging works fine but page numbers appear as
Prev 1 2 3 4 Next

However I need it to display links as
Prev Page 1 of 4 Next

Could you please advise me as to how I can use PageNumber and PageCount  to achive paging as above?

 
<sf:Pager ID="pager1" runat="server">
    <LayoutTemplate>
        <asp:Repeater ID="PageRepeaterLinkButton" runat="server">
            <HeaderTemplate>
                <div class="floatRt">
                        <asp:LinkButton ID="PreviousPage" runat="server" Text="<%$Resources:PreviousPage %>"></asp:LinkButton>
  
            </HeaderTemplate>
            <ItemTemplate>
                 
                    <asp:LinkButton ID="SingleItem" runat="server" />
            </ItemTemplate>
            <FooterTemplate>
                 
                    <asp:LinkButton ID="NextPage" runat="server" Text="<%$Resources:NextPage %>"></asp:LinkButton>
                </div>
            </FooterTemplate>
        </asp:Repeater>
        <asp:Repeater ID="PageRepeaterHyperLink" runat="server">
            <HeaderTemplate>
                <div class="floatRt">
                        <asp:HyperLink ID="PreviousPage" runat="server" Text="<%$Resources:PreviousPage %>"></asp:HyperLink>
  
            </HeaderTemplate>
            <ItemTemplate>
                 
                    <asp:HyperLink ID="SingleItem" runat="server" />
            </ItemTemplate>
            <FooterTemplate>
                 
                    <asp:HyperLink ID="NextPage" runat="server" Text="<%$Resources:NextPage %>"></asp:HyperLink>
                    </div>
            </FooterTemplate>
        </asp:Repeater>
    </LayoutTemplate>
</sf:Pager>

 

Rajesh
Top achievements
Rank 1
 asked on 12 Nov 2010
7 answers
249 views
Windows 7 x64, VS 2008, ASP.Net AJAX v 2010.2.826.35.

I'm auto generating RadGrids from the database using codesmith/nettiers and it works perfectly for some tables but doesn't for others. This particular issue only seems to be IE as it works in other browsers. It also happens whether there is data or not.

Bascially it gets confused with the position on the scrollbar and as you scroll right it can reset back to the left or as you reach the end of the table it loses track of earlier columns and just shows the last page with the scrollbar on the left and then last field with the scrollbar disabled.

If I drag the scrollbar to the right it continuosly moves left/right and occasionalyy I get an 'Unspecified Error' on:-

setTimeout(

"Telerik.Web.UI.Grid.frozenScrollHanlder("+this._frozenScrollCounter+")",0);

 

 

 

 

 

I think the issue is a problem with the column headers - below is a single column for a RadGrid that scrolls perfectly. 
 
<telerik:GridBoundColumn DataField="LabourCardNumber" HeaderText="Labour Card Number" SortExpression="[LabourCardNumber]" HeaderStyle-Width="100px" HeaderStyle-VerticalAlign="Top" ItemStyle-VerticalAlign="Top" /> 

 

 

 

 

 

 

if I do something as simple as changing the HeaderText to "Labour Card Number Reference"  the horizontal scrollbar no longer functions correctly in IE (6,7 or 8).

Think its something to do with the length of the HeaderText. Can you confirm its an issue and being looked into?

Thanks

B

Jeff Wickersham
Top achievements
Rank 1
 answered on 12 Nov 2010
1 answer
86 views
Hello,

To reproduce the issue open your demo in Chrome or FireFox.
http://demos.telerik.com/aspnet-ajax/scheduler/examples/resourcegrouping/defaultcs.aspx

Then select 
- Group by room
- Group by date
- Grouping direction: Vertical

Look at the left column. Unlike IE, these browsers display day of week and day number in the same column as the time. This leads to desync between column headers and the actual timeslots. If you scroll down, you may see that the gap between them is about a 0.5 cm!
Hello

To reproduce the issue open your demo in Chrome or FireFox.
http://demos.telerik.com/aspnet-ajax/scheduler/examples/resourcegrouping/defaultcs.aspx

Then select 
- Group by room
- Group by date 
- Grouping direction: Vertical

Look at the left column. Unlike IE, these browsers display day of week and day number in the same column as the time. This leads to desync between column headers and the actual timeslots. If you scroll down, you may see that the gap between them is about a 0.5 cm!
Kamen Bundev
Telerik team
 answered on 12 Nov 2010
1 answer
66 views
Hi All,
I have noticed a problem with the Grid inputs.
Given a normal Grid setup and a Bound string Column, a user hits Add and enters in the string :
<Test
Hitting save will yeild a framework error that starts with :
A potentially dangerous Request.Form value was detected from the client ...
This is not acceptable, as we have no control over user entry and we infact encourage the use of markup to format the inputs used later in forms. I realise that the use of an HTMLEditorColumn will in some way remove the problem for this field, but the risk still applies for all text inputs in grids.
What can be done about this?  Can this error be trapped and dealt with client-side?
Will client-side scripting need to be implemented to "sanitise" the input before sending the request back to the server? If so, what rules do I need to apply to sanatise the data?
Thanks for your help,
Steele.
Dimo
Telerik team
 answered on 12 Nov 2010
6 answers
106 views
Hi

I'm using RadWindow to edit and insert records for RadGrid. The RadWindow can open and close but it will not re-bind the RadGrid for second time when close that opened RadWindow.When i click editlink for the second time radwindow is opening and Updation of the record is happening and radwindow is closing,but radgrid in parent page is not refreshing for the second time in Mozilla browser.

Everything is working fine in IE,the problem is with the Mozilla

Please help
Georgi Tunev
Telerik team
 answered on 12 Nov 2010
2 answers
405 views
Hello - I would like to customize the background color of a row when it's highlighted and selected.  I've tried the following, but it only works a little.

When hovered, the background color changes, but an ugly gray border still exists along the bottom of the row.  Also, when selected, my desired background color only shows up when the selected row is hovered, not all the time.

The ASP/CSS I'm using are below:

ASP for Grid:
<!-- Grid -->
<telerik:RadGrid runat="server" ID="rgReport">
    <%-- Client settings --%>
    <ClientSettings EnableRowHoverStyle="true" Selecting-AllowRowSelect="true" />
    <%-- SelectedItemStyle settings --%>
    <SelectedItemStyle BackColor="Black" />
      
    <%-- MasterTableView Settings --%>
    <MasterTableView AllowSorting="true" Caption="" Summary="" ItemStyle-VerticalAlign="Top" />
</telerik:RadGrid>

CSS for Grid:
tr.rgRow:hover, tr.rgAltRow:hover
{
    background-image: none;
    background-color: #E9E8D1;
    border-bottom: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;
}

Please let me know what I can do...  Thanks!

-Ryan
Ryan
Top achievements
Rank 1
 answered on 12 Nov 2010
1 answer
115 views
Hi,

I am using Radlistbox for my custom TransferListbox control for which i set

AllowTransfer =

 

true;

 

AllowTransferAll = true;

 

. But i want in my custom control to reorder the transfer buttons like  the order of the buttons to: To right (selected), To Right (all), To left (all), To Left (selected).
Is it possible in RadListbox?

Thanks & Regards,
Anita.


Yana
Telerik team
 answered on 12 Nov 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
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?