Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
156 views
Hi,

I have a RadGrid which has AllowMultiRowSelect property to true. I have a button and on click of button i need to fetch details of selected rows.
I have wriiten following code on button click

 

protected void OnButtonClick( object sender,EventArgs e )

 

{ ArrayList ar = new ArrayList();

 

 

  

foreach (GridDataItem item in RadGridFrom.SelectedItems)

 

    {        ar.Add( item["Column1"].Text);//access the value here    

     }
}
but SelectedItems collectioin always have O items , I am not able to figure out why this is happening.

I also tried following code for fetching details of selected rows :

 

 

protected void OnButtonClick( object sender,EventArgs e )

 

{

   ArrayList ar = new ArrayList();

 foreach (GridDataItem item in RadGridFrom.MasterTableView.Items)

 

    {

         if (item.Selected)

 

        ar.Add( item["Column1"].Text);//access the value here    
    }

 

}

 but still it is not working.
I am using Telerik.Web.UI_2011_2_915_Trial dll
Kindly help with the solution ASAP.

Thanks,
Bhupendra

Rahul
Top achievements
Rank 2
 answered on 23 Dec 2011
1 answer
121 views
Hi all,

I used Telerik Control to develop my project. I have a problem below:


<telerik:GridTemplateColumn HeaderText="[Groupes]" UniqueName="GroupeContent">
                                <ItemTemplate>
                                    <asp:LinkButton ID="lblNom" CommandName="Select" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Nom") %>' />
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="txtNom" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Nom") %>'
                                        MaxLength="30"></asp:TextBox>
                                </EditItemTemplate>

                              
                            </telerik:GridTemplateColumn> 
<telerik:GridTemplateColumn  UniqueName="GroupeFooter">
                                <ItemTemplate>
                                    <asp:ImageButton ID="ImageButton1" runat="server" CausesValidation="false" CommandName="Edit" 
                                        ImageUrl="~/Styles/images/edit16.gif" />
                                </ItemTemplate>
                                <EditItemTemplate>                                    
                                   .............
                                </EditItemTemplate
>                                
                            </telerik:GridTemplateColumn>

When I click on the icon "edit"=> TextBox appears and 2 link "update" "Cancel" are shown.

I want to replace 2 link "update" and "cancel" by 2 icons.
Please view attached file

Please help me to do it

Thanks alot.

Rahul
Top achievements
Rank 2
 answered on 23 Dec 2011
2 answers
114 views
in telerik grid I had a template field and included an ASP button in it
I want 2 simple task to be performed from this button 
1)I want to select different values in the Grid by that button click and pass it in session variable Or if possible to select the PK of that tuple.I am using LINQ and binding the grid from code behind.
 2) I wan to conditionally enable and disable button present in template field of RAD Grid 


Thanks 
usman
Top achievements
Rank 1
 answered on 23 Dec 2011
1 answer
150 views
Hi,

We are using RadGrid with EntityDatasource. We have pagination enabled on the RadGrid.
We loooked at the sql profiler and saw that RadGrid makes two calls to the database (through EntityDatasource). One call is for getting the total count (for displaying pages and count) and the second is for fetches actual records in the page.

Later when we move to the second page, I can see in the sql profiler that again two calls are made - one for count and other for all the rows of the second page.

Can we configure the radgrid such that it does not fetch the count on second or subsequent operations (like moving to next page or sorting)? Since the grid already has the total count whcih it gets on the first load, cant the radgrid maintian this and use this in the subsequent operations?

Thanks and Regards,
Bhaskar Shanbhag

PS. I am asking this question since our sql query which we use in the Entity Datasource is already very slow and calling it two times for every operation makes it slower.
Veli
Telerik team
 answered on 23 Dec 2011
1 answer
107 views
Hi all,
I used RADTelerik and I have a problem: I don't know replace link by TExt by ICON.
My code Page:

<telerik:GridTemplateColumn HeaderText="[Groupes]" UniqueName="GroupeContent">
                                <ItemTemplate>
                                    <asp:LinkButton ID="lblNom" CommandName="Select" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Nom") %>' />
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="txtNom" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Nom") %>'
                                        MaxLength="30"></asp:TextBox>
                                </EditItemTemplate
>
                               
                            </telerik:GridTemplateColumn>
....
I want to replace the 2 link "update" and "cancel" by icons.
Pls view attached file.

Thanks alot

Rahul
Top achievements
Rank 2
 answered on 23 Dec 2011
3 answers
203 views
Hi telerik team,

I'm using the Radtreeview structure in my application.
I have 3 nodes and for each node it has the subnodes.I'm adding the nodes dynamically from code behind.I would like to add Linkbutton and the image controls in the Nodetemplate for each node.

Node1
    --subnode1.1
    --subnode1.2
    --subnode1.3
Node2
    --subnode2.1
    --subnode2.2
Node3
    --subnode3.1
    --subnode3.2
    --subnode3.3
    --subnode3.4
Now for each nodes[Node1,Node2,Node3],i want to add the nodetemplates respectively.Here nodetemplate contains Linkbutton and Imagebutton.
How to add this from codebehind.
Please reply ASAP

Thankyou...




Bozhidar
Telerik team
 answered on 23 Dec 2011
3 answers
103 views
Hi all :
I have RadAsyncupload inside Sharepoint site page,  it works with ie and firefox but it doesn't work with  ie 64bit .

Is there any idea or workaround??
Genady Sergeev
Telerik team
 answered on 23 Dec 2011
1 answer
167 views
Hello,
I have RadEditor and a Table within a RadListView.
When someone clicks on one of the cells in the Table, I want to paste text from the cell into the RadEditor.
I have the functionality working when the RadEditor is not within a RadListView, but I am not sure how to make it work within the RadListView.

Here is the code for the RadEditor when it is not in the RadListView -

                        <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
                            <script type="text/javascript">
                                $(document).ready(function ()
                                {
                                    $('.clickMe').each(function ()
                                    {
                                        $(this).attr("unselectable", "on");
                                        $(this).click(function ()
                                        {
                                            var editor = $find("<%=reKeyLink.ClientID%>");
                                            editor.pasteHtml($(this).text());
                                        });
                                    });
                                });
                            </script>
                        </telerik:RadScriptBlock>
 
-------------------------------------------------------------------------------
 
                        <div style="clear: left; margin-top: 15px; width:825px">
                            <div style="float:left;">
                                <telerik:RadEditor ID="reKeyLink" runat="server" Skin="Windows7" ViewStateMode="Disabled"
                                    ToolsFile="~/App_Themes/public/ToolsLimited.xml" Height="235px" Width="625px">
                                </telerik:RadEditor>
                            </div>
                             
                            <div class="Tokens" id="overlay" style="float:left; visibility:hidden; border: 1px solid #A5B3C5; width:185px; text-align:center; margin-left:10px;">
                             
                                <table id="tableid">
                                    <tr style="width:184px">
                                        <td class="clickMe" style=" text-align:right; width:92px">{ACCOUNT_ID}</td><td style="width:5px"></td><td class="clickMe" style=" text-align:left">{ADDR_LINE1}</td>
                                    </tr>
                                    <tr>
                                        <td class="clickMe" style=" text-align:right">{ADDR_LINE2}</td><td style="width:5px"></td><td class="clickMe" style=" text-align:left">{CITY}</td>
                                    </tr>
                                    <tr>
                                        <td class="clickMe" style=" text-align:right">{COMPANY}</td><td style="width:5px"></td><td class="clickMe" style=" text-align:left">{EMAIL_ADDR}</td>
                                    </tr>
                                    <tr>
                                        <td class="clickMe" style=" text-align:right">{FIRST_NAME}</td><td style="width:5px"></td><td class="clickMe" style=" text-align:left">{LAST_LOGIN}</td>
                                    </tr>
                                    <tr>
                                        <td class="clickMe" style=" text-align:right">{LAST_NAME}</td><td style="width:5px"></td><td class="clickMe" style=" text-align:left">{LOCATION}</td>
                                    </tr>
                                    <tr>
                                        <td class="clickMe" style=" text-align:right">{MIDDLE_INIT}</td><td style="width:5px"></td><td class="clickMe" style=" text-align:left">{NICKNAME}</td>
                                    </tr>
                                    <tr>
                                        <td class="clickMe" style=" text-align:right">{POS_CUST_ID}</td><td style="width:5px"></td><td class="clickMe" style=" text-align:left">{PREFIX_NAME}</td>
                                    </tr>
                                    <tr>
                                        <td class="clickMe" style=" text-align:right">{REVIEWER_ID}</td><td style="width:5px"></td><td class="clickMe" style=" text-align:left">{STATE}</td>
                                    </tr>
                                    <tr>
                                        <td class="clickMe" style=" text-align:right">{SUFFIX_NAME}</td><td style="width:5px"></td><td class="clickMe" style=" text-align:left">{ZIPCODE}</td>
                                    </tr>
                                </table>
 
                            </div>
 
                            <div style="clear: left;">
                                <asp:RequiredFieldValidator ID="rfvKeyLink" runat="server" ControlToValidate="reKeyLink"
                                    ValidationGroup="AddKeyLink" Display="Dynamic" Text="Key link text is required." />
                            </div>
 
                        </div>

I wish to make the code above to work in a RadListView defined like so -
                <telerik:RadListView runat="server" ID="rlvKeyLinks" Skin="Windows7" EnableEmbeddedSkins="true"
                    RegisterWithScriptManager="true" AllowMultiItemEdit="false" OnNeedDataSource="RlvKeyLinks_NeedDataSource"
                    OnItemCommand="RlvKeyLinks_ItemCommand" OnItemCreated="RlvKeyLinks_ItemCreated"
                    AllowCustomPaging="true" AllowPaging="true" ItemPlaceholderID="phKeyLinksView"
                    DataKeyNames="ID">
 
 
-------------RadEditor and Table here--------------
 
 
                </telerik:RadListView>

Can you help?
Thanks!



Tsvetina
Telerik team
 answered on 23 Dec 2011
3 answers
128 views
Here is the code...

protected void btnOutlookExport_Click(object sender, EventArgs e)
{
   WriteCalendar(rsReservations.ExportToICalendar(rsReservations.Appointments));
}

and this is the error I am getting:

Compiler Error Message: CS0176: Member 'Telerik.Web.UI.RadScheduler.ExportToICalendar(Telerik.Web.UI.AppointmentCollection)' cannot be accessed with an instance reference; qualify it with a type name instead

What am i missing? How should I be accessing the appointments?

Visual Studio underlines ExportToICalendar in red and says...
C#: Cannot access a static method on an instance

The demos show this method being used and it works on the demos. Is there something I am missing?

Thanks in advance for your time and help.
Arsalan
Top achievements
Rank 1
 answered on 23 Dec 2011
2 answers
88 views
Hi,

I want to load a page with a RadDock object initially hidden from view.  I have used both that pageLoad event and also the OnClientInitialize event with a set_visible(false) command.  Both of these work however you see the RadDock window before it disappears.

I have thought of having the initial position being off page but then I have to ensure that the page is set to have no scrollbars or they will flash up.  One fudge after another :(

Without a fudge is there a way to have the object rendered yet remain initially visible?  

Best Regards,

Jon



Slav
Telerik team
 answered on 23 Dec 2011
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?