Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
104 views
Hi,
    I might be misunderstanding the use of ConfirmText on a GridButtonColumn, but if the user chooses "Cancel" then I would expect the ItemCommand event would not fire?  We have a grid with a Delete button seen here
<telerik:GridButtonColumn Text="Delete" CommandName="Delete" ButtonType="ImageButton"
                    ConfirmText="Are you sure you want to delete this attachment?">
                    <HeaderStyle Width="20px" />
                </telerik:GridButtonColumn>
 
The code for performing the delete occurs in the ItemCommand event.  Unfortunately no matter what the user chooses (both Ok or Cancel) the event still fires performing the delete.  Is this the correct behavior?  If so, is there an argument I can grab from the GridCommandEventArgs to determine if the user select Ok or Cancel?

Thanks,
Mike
Vasil
Telerik team
 answered on 03 Nov 2010
11 answers
132 views
Hello,

I want to drag mouse over time-slot to select long time-slot can is this be possible ?? if yes how ??

for e.g.: If I drag mouse from 9:00AM to 1:00PM and on enter it should open insert/edit page., is it possible ?

Thank You!
Peter
Telerik team
 answered on 03 Nov 2010
1 answer
208 views
I have a page with a RadListView Control:

    <telerik:RadListView ID="rlv_Responses" runat="server" DataKeyNames="IDTicketsResponses" 
        DataSourceID="sds_Responses" Skin="WebBlue" BorderColor="#5A7594" 
               BorderStyle="Solid" BorderWidth="1px" Width="400px">
    <AlternatingItemTemplate>
        <div class="rlvA">
            <table cellpadding="3" cellspacing="0" 
                style="border: thin solid #293852; padding: 10px; width: 100%">
                <tr>
                    <td style="padding: 5px">
                        <asp:Label ID="lbl_EnteredDate" runat="server" Text='<%# Eval("EnteredDate") %>' />
                    </td>
                </tr>
                <tr>
                    <td style="padding: 5px">
                        <asp:Label ID="lbl_FullName" runat="server" style="font-weight: 700; color: #597791" Text='<%# Eval("FullName") %>' />
                    </td>
                </tr>
                <tr>
                    <td style="padding: 5px">
                        <asp:Label ID="lbl_Response" runat="server" Text='<%# Eval("Response") %>' />
                        <asp:Label ID="lbl_TicketsResponses" runat="server" Text='<%# Eval("IDTicketsResponses") %>' />
                    </td>
                </tr>
                <tr>
                    <td style="padding: 5px">
                        <asp:Button ID="SelectButton" runat="server" CommandName="Select" Text="Details" />
                        <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
                    </td>
                </tr>
            </table>
                                      
        </div>
    </AlternatingItemTemplate>
    <InsertItemTemplate>
    </InsertItemTemplate>
    <ItemTemplate>
        <div class="rlvI">
            <table cellpadding="3" cellspacing="0" 
                style="border: thin solid #293852; padding: 10px; width: 100%; background-color: #E6E6E6;">
                <tr>
                    <td style="padding: 5px;">
                        <asp:Label ID="lbl_EnteredDate0" runat="server" 
                            Text='<%# Eval("EnteredDate") %>' />
                    </td>
                </tr>
                <tr>
                    <td style="padding: 5px;">
                        <asp:Label ID="lbl_FullName0" runat="server" 
                            style="font-weight: 700; color: #597791" Text='<%# Eval("FullName") %>' />
                    </td>
                </tr>
                <tr>
                    <td style="padding: 5px;">
                        <asp:Label ID="lbl_Response0" runat="server" Text='<%# Eval("Response") %>' />
                        <asp:Label ID="lbl_TicketsResponses0" runat="server" Text='<%# Eval("IDTicketsResponses") %>' />
                    </td>
                </tr>
                <tr>
                    <td style="padding: 5px;">
                        <asp:Button ID="SelectButton" runat="server" CommandName="Select" Text="Details" /><asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
                             
                          
                    </td>
                </tr>
            </table>
        </div>
    </ItemTemplate>
    <EmptyDataTemplate>
        <div class="RadListView RadListView_Default">
            <div class="rlvEmpty">
                There are no items to be displayed.</div>
        </div>
    </EmptyDataTemplate>
    <LayoutTemplate>
        <div class="RadListView RadListView_Default">
            <div ID="itemPlaceholder" runat="server">
            </div>
        </div>
    </LayoutTemplate>
    <SelectedItemTemplate>
        <div class="rlvISel">
             <asp:Label ID="lbl_EnteredDate1" runat="server" 
                Text='<%# Eval("EnteredDate") %>' />
             <asp:Label ID="lbl_FullName1" runat="server" 
                Text='<%# Eval("FullName") %>' />
             <asp:Label ID="lbl_Response1" runat="server" 
                Text='<%# Eval("Response") %>' />
             <asp:Label ID="lbl_TicketsResponses1" runat="server"
                Text='<%# Eval("IDTicketsResponses") %>' />
        </div>
    </SelectedItemTemplate>
</telerik:RadListView>

Because I need to get the value of the DataKey from the list view I need to open a RadWindow during the ItemCommand Event in the code behind:

Protected Sub RadListView1_ItemCommand(ByVal sender As Object, ByVal e As RadListViewCommandEventArgs) Handles rlv_Responses.ItemCommand
       If e.CommandName = RadListView.SelectCommandName Then
           Dim item As RadListViewDataItem = TryCast(e.ListViewItem, RadListViewDataItem)
           Dim IDTicketsResponses As String = item.GetDataKeyValue("IDTicketsResponses").ToString()
           Session("IDTicketsResponses") = IDTicketsResponses
           Dim scriptstring As String = "radopen('helpdesk_tickets_respond_edit.aspx', 'EditResponse');"
           RadAjaxManager1.ResponseScripts.Add(String.Format("refreshGrid('{0}')", "Server Response!"))
           ScriptManager.RegisterStartupScript(Me, Me.[GetType](), "radopen", scriptstring, True)
       End If
   End Sub

Before adding the ListView control to the ASPX page, I used to open the window from the ASPX page using Java:

    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript" language="javascript">
            function getQuerystring(key, default_) {
                if (default_ == null) default_ = "";
                key = key.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
                var regex = new RegExp("[\\?&]" + key + "=([^&#]*)");
                var qs = regex.exec(window.location.href);
                if (qs == null)
                    return default_;
                else
                    return qs[1];
            }
            function AddResponse() {
                var param1 = getQuerystring('IDTicket');
                var param2 = getQuerystring('IDRequestor');
                var oWnd = radopen("helpdesk_tickets_respond.aspx?IDTicket=" + param1 + "&IDRequestor=" + param2, "UserListDialog");
                return false;
            }
            function refreshGrid(arg) {
                if (!arg) {
                    $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
                }
            }
</script>
    </telerik:RadCodeBlock>

And close the RadWindow that was opened with this Java:

<script type="text/javascript">
    function Close(args) {
        GetRadWindow().BrowserWindow.refreshGrid(args);
        GetRadWindow().close();
    }
    function GetRadWindow() {
        var oWindow = null;
        if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog
        else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; //IE (and Moz as well)
        return oWindow;
    }
    function CancelEdit() {
        GetRadWindow().close();
    }
       </script>


When I used the ASPX page and java to open the window and then closed the window, the java did a great job of calling the RadAjaxManager and refreshing my ListView.

Now when I open the window from the VB code behind, the RadAjaxManager is no longer called when the pop up window is closed.

How can I ensure that the the RadAjaxManager fires when the pop up window closes even though the pop up is opened from the code behind?

I hope this was not TOO confusing. :)




Tsvetina
Telerik team
 answered on 03 Nov 2010
5 answers
563 views
Hi all,

I'm wondering if anyone knows if it's possible to have a RadGrid in RadGrid. Previously, I was able to do something similar where I had a DataList within a RadGrid column like so:

 

 

<telerik:GridTemplateColumn HeaderText="Keys" DataField="Keys">

 

 

 

<ItemTemplate>

 

 

 

<asp:DataList ID="DataList1" runat="server" DataSource='<%# Eval("Keys") %>'>

 

 

 

<ItemTemplate>

 

 

 

<asp:Label ID="Label1" runat="server" Text='<%# Eval("Number") %>'></asp:Label>

 

 

 

</ItemTemplate>

 

 

 

</asp:DataList>

 

 

 

</ItemTemplate>

 

 

 

</telerik:GridTemplateColumn>

 


Note, in this code, I used data binding with the DataSource property in DataList. I was thinking I could so something similar with RadGrid. However, I just realized that RadGrid has no DataSource property.

Has anyone ever tried putting a RadGrid in a column in another RadGrid? Is there a way to do it, or is this a known limitation?

Jon
Jon
Top achievements
Rank 1
 answered on 03 Nov 2010
7 answers
169 views
Hello ALL,

              I have Rad Grid on page, now i need to apply inline edit functionality for grid,can you please suggest me how can i achieve edit/update functionality for grid?

Thanks
Kaushal
Vasil
Telerik team
 answered on 03 Nov 2010
5 answers
316 views
I am struggling with figuring out how to prevent an inner grid from triggering an ajaxmanager on a parent grid from repainting the parent grid..

1. The user loads the page.
---------(contains a grid,with expandable rows .. the rows have a tab control. tab 1=a form,  tab 2 = inventory list as a grid)
2.  The primary grid loads.
3.  The user clicks on a row - expands.
4.  The user then clicks on a tab (inventory) and a grid is displayed showing a list of items in another grid.
5.  The user clicks on the inventory grid in the tab to sort.
6.  The ajax seems to fire for the entire page instead of being limited tojust the innner grid in the tab control.

Any ideas?

Tsvetina
Telerik team
 answered on 03 Nov 2010
3 answers
171 views
Hello,

i have radgrid which has two bound columns and two template columns with radcombobox in edititemtemplate ..i've given the items their itself with values ...values to them will be coming from database.....my problem is that they r showing values which r coming directly from database .with out showing their text.. .

EX:-in the rad grid display  it is showing lvl1 instead of LEVEL1

Here is my code

<

telerik:RadGrid ID="grdCMS" runat="server" OnNeedDataSource="grdCMS_NeedDataSource"

 

 

AutoGenerateColumns="False" OnInsertCommand="grdCMS_Insert" OnItemCreated="grdCMS_ItemCreated"

 

 

OnItemDataBound="grdCMS_ItemDataBound" OnEditCommand="Editing"

 

 

OnDeleteCommand="grdCMS_Delete" OnItemCommand="grdCMS_ItemCommand" AllowSorting="true">

 

 

<MasterTableView CommandItemDisplay="Top" EditMode="InPlace" DataKeyNames="seqNo">

 

 

<Columns>

 

 

<telerik:GridEditCommandColumn UpdateText="Update" ButtonType="ImageButton" ></telerik:GridEditCommandColumn>

 

 

<telerik:GridDropDownColumn DataField="seqNo" ListTextField="seqNo" ListValueField="seqNo" ListDataMember="testcms"

 

 

UniqueName="seqNo" HeaderText="Sequence Number">

 

 

 

</telerik:GridDropDownColumn>

 

 

<telerik:GridBoundColumn DataField="lvlqtn" HeaderText="Levelling Question" UniqueName="lvlqtn" >

 

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridTemplateColumn>

 

 

<HeaderTemplate>

 

 

<asp:Label ID="lblhdryes" Text="Level If Yes" runat="server"></asp:Label>

 

 

</HeaderTemplate>

 

 

<ItemTemplate>

 

 

<asp:Label ID="lbllvlyes" runat="server" Text='<%# Eval("lvlyes") %>'></asp:Label>

 

 

</ItemTemplate>

 

 

<EditItemTemplate>

 

 

<telerik:RadComboBox ID="rcblvlyes" runat="server" >

 

 

<Items>

 

 

<telerik:RadComboBoxItem Text="Level1" Value="lvl1" />

 

 

<telerik:RadComboBoxItem Text="Level2" Value="lvl2" />

 

 

<telerik:RadComboBoxItem Text="Level3" Value="lvl3" />

 

 

<telerik:RadComboBoxItem Text="Level4" Value="lvl4" />

 

 

</Items>

 

 

</telerik:RadComboBox>

 

 

</EditItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn>

 

 

<HeaderTemplate>

 

 

<asp:Label ID="lblhdrlvlno" Text="Level If NO" runat="server"></asp:Label>

 

 

</HeaderTemplate>

 

 

<ItemTemplate>

 

 

<asp:Label ID="lbllvlno" runat="server" Text='<%# Eval("lvlno") %>'></asp:Label>

 

 

</ItemTemplate>

 

 

<EditItemTemplate>

 

 

<telerik:RadComboBox ID="rcblvlno" runat="server">

 

 

<Items>

 

 

<telerik:RadComboBoxItem Text="Level1" Value="lvl1" />

 

 

<telerik:RadComboBoxItem Text="Level2" Value="lvl2" />

 

 

<telerik:RadComboBoxItem Text="Level3" Value="lvl3" />

 

 

<telerik:RadComboBoxItem Text="Level4" Value="lvl4" />

 

 

</Items>

 

 

</telerik:RadComboBox>

 

 

</EditItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

 

<telerik:GridButtonColumn CommandName="Delete" Text="Delete"

 

 

ButtonType="ImageButton" ConfirmText="Do u Want to Delete the row" ConfirmTitle="Confirmation" ConfirmDialogType="RadWindow"></telerik:GridButtonColumn>

 

 

</Columns>

 

 

</MasterTableView>

 

 

</telerik:RadGrid>


 

Marin
Telerik team
 answered on 03 Nov 2010
1 answer
496 views
Hi !
I have a radgrid with a datasource creating dynamicaly.it means columns create programatically and add to radgrid,so before runtime it is not clear  number of columns or their names.
and some columns have header .it means a radgrid with 2 rows in header.
now i want to create a <table> with two <tr> and add columns header to <td>.
then add this <table> to GridTemplateColumn -> HeaderTemplate.
like this:
<telerik:GridTemplateColumn UniqueName="TemplateColumn" SortExpression="CompanyName"
                        InitializeTemplatesFirst="false">
                        <FooterTemplate>
                            Template column footer</FooterTemplate>
                        <FooterStyle VerticalAlign="Middle" HorizontalAlign="Center" />
                        <HeaderTemplate>
                            <table id="Table1" cellspacing="0" style="width:240px;" class="myTable">
                                <tr>
                                    <td colspan="2" align="center">
                                        <b>Contact details</b></td>
                                </tr>
                                <tr>
                                    <td style="width: 50%">
<asp:LinkButton CssClass="Button" ID="btnContName" Text="Contact name" ToolTip="Sort by ContactName"
CommandName='Sort' CommandArgument='ContactName' runat="server" /></td>

                                    <td style="width: 50%">
<asp:LinkButton CssClass="Button" ID="btnContTitle" Text="Contact title" ToolTip="Sort by ContactTitle"
CommandName='Sort' CommandArgument='ContactTitle' runat="server" /></td>

                                </tr>
                            </table>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <table cellspacing="0" width="100%" class="myTable">
                                <tr>
                                    <td style="width: 50%">
                                        <%# Eval("ContactName") %>
                                    </td>
                                    <td style="width: 50%">
                                        <%# Eval("ContactTitle") %>
                                    </td>
                                </tr>
                            </table>
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" />
                    </telerik:GridTemplateColumn>


but this is in design time.i want create this in run time.(code behind)
how can i do this?

thanks.
Vasil
Telerik team
 answered on 03 Nov 2010
0 answers
74 views
Sry - Moved to correct place....
Bernard Myers
Top achievements
Rank 1
 asked on 03 Nov 2010
2 answers
160 views
Hi
I have radgrid which displays values in CSV format. But when there are many values the CSV string becomes too long and makes the column long as well. Is there any way in Radgrid using which I can break that line in multiple line?


Ex..

CSV1,CSV2,CSV3,CSV4,CSV5,CSV6


Desired..

CSV1,CSV2,CSV3
CSV4,CSV5,CSV6




Thanks
Parvez
Top achievements
Rank 1
 answered on 03 Nov 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?