This is a migrated thread and some comments may be shown as answers.

RadXmlHttp Gridwiew Click Event Problem

5 Answers 86 Views
XmlHttpPanel
This is a migrated thread and some comments may be shown as answers.
Hakan
Top achievements
Rank 1
Hakan asked on 01 Jul 2010, 10:42 PM
I have  2 RadXmlpHttp Panel of of them,When I select row,textboxes fill.Another one when I click a button which rebind Grid but,I cant select rows of grid again.Also When I use filter in grid there are script error on button click event.

<telerik:RadXmlHttpPanel ID="RadXmlHttpPanel1" runat="server" OnServiceRequest="XmlHttpPanel_ServiceRequest" RenderMode="Block">
<asp:Button ID="Button1" runat="server" OnClientClick="UpdateGrid();return false;" Text="Button" />

<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>

<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>

<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>

</telerik:RadXmlHttpPanel>

<telerik:RadXmlHttpPanel ID="RadXmlHttpPanel2" runat="server" OnServiceRequest="XmlHttpPanel_ServiceRequest2"

RenderMode="Block">

<telerik:RadGrid ID="RadGrid1" Skin="Hay" OnNeedDataSource="RadGrid1_NeedDataSource"

Width="370px" AllowSorting="True" PageSize="10" AllowPaging="True" runat="server"

AutoGenerateColumns="false" GridLines="None">
<MasterTableView ClientDataKeyNames="Id" Width="100%" >
<Columns>

<telerik:GridBoundColumn DataField="Id" Visible="false">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn HeaderText="Name" DataField="Header" UniqueName="Header" >

</telerik:GridBoundColumn>

<telerik:GridBoundColumn HeaderText="Address" DataField="ShortDescription" UniqueName="ShortDescription">

</telerik:GridBoundColumn>

</Columns>

</MasterTableView>

<PagerStyle Mode="Slider" PageButtonCount="5" />

<ClientSettings EnableRowHoverStyle="true" Selecting-AllowRowSelect="true" ClientEvents-OnRowSelected="rowSelected">

</ClientSettings>

</telerik:RadGrid>

</telerik:RadXmlHttpPanel>



ANd CodeBehind

 

 

 

protected void Page_Load(object sender, EventArgs e)

 

{

}

 

 

 

protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)

 

{

RadGrid1.DataSource =

 

 

db.dbRead("Select * from Doctors");

 

}

 

protected void XmlHttpPanel_ServiceRequest(object sender, RadXmlHttpPanelEventArgs e)

 {
string val = e.Value;
DataSet ds = db.dbRead("Select * from Doctors where Id=" + val + "");

TextBox1.Text = ds.Tables[0].Rows[0]["Header"].ToString();

TextBox2.Text = ds.Tables[0].Rows[0]["ShortDescription"].ToString();

TextBox3.Text = val;

}
protected void XmlHttpPanel_ServiceRequest2(object sender, RadXmlHttpPanelEventArgs e)

{
DataSet ds = db.dbRead("Select top 5 * from Doctors");

RadGrid1.DataSource = ds;

RadGrid1.DataBind();

}

 

5 Answers, 1 is accepted

Sort by
0
Hakan
Top achievements
Rank 1
answered on 03 Jul 2010, 09:50 AM
Why noone answered this question,I cound't understand ultil this time.But I solved the problem.Problem related with radgrid pager Mode When it is Slider mode there is a problem.it can not register??? Why I dont know but.When I made Numeric mode,Problem Solved.

Thank you Telerik  Team for your helps...
0
Pero
Telerik team
answered on 06 Jul 2010, 11:05 AM
Hi Hakan,

This is a known issue, when using the RadGrid with the XmlHttpPanel, and the Grid has  PagerStyle.Mode=Slider. Please use different mode for the Grid's PagerStyle.

Best wishes,
Pero
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Francis Frank
Top achievements
Rank 1
answered on 13 Oct 2010, 01:35 PM
Please Team,

I have been in a problem for a long time enough to go half my project.

I  have a RadListView which is inside an RadXmlHttp control.
Inside this RadListView, i have a table where i placed a hyperlink which should trigger an event - but this has been a bottle neck.

I tried the fellowing Java scripts but they didnt help.
I also tried to see if i could create a code behind file (which will be better for my need) but i dont know how to get though because the hyperlink control is hidden.

function getControl() {
                var masterTable = $find("<%=RadXmlHttpPanelInfoCustomer.ClientID%>").get_MenuView();
                var lnk = masterTable.findControl('lnkAddToCart');
                lnk.set_text("ok");
            }

The Below could not respond to click after i added onclick="GetRegisterServerElements(this);"  to the hyperlink click event
   //global DOM ID registry.  filled up by scripts rendered from templates.
            var registeredElements = [];
            //looks for an element that has been registered with the global array
            //requires that we emit a registration script block for each server control
            function GetRegisteredServerElement(serverID) {
                var clientID = "";
                for (var i = 0; i < registeredElements.length; i++) {
                    clientID = registeredElements[i];
                    if (clientID.indexOf(serverID) >= 0)
                        break;
                }
                //return document.getElementById(clientID);
                alert(document.getElementById(clientID));
            }

I WILL APPRECIATE A QUICK RESPONDE

Great Appreciation Guys,
0
Francis Frank
Top achievements
Rank 1
answered on 15 Oct 2010, 10:59 AM
Thanks Team,

I appreciate your concern each time we encounter dificulties.

I have been able to solve my problem
It was quite easier than i thought -
what i did:
I placed this on the click event of the encapsulated control: onclick="AddToCart(event, 'lnkAddToCart')

With the below Jscipt function, I was able to get the control ID which happen to be idFrag
function AddToCart(e, idFrag) {             
                var panel = $find("<%= RadXmlHttpPanelInfoCustomer.ClientID %>");           
                panel.set_value("added");
            }
With the above, i could know when the AddToCart link was clicked.

ITS FUN USING TELERIK !!! cheers
(If their are other solutions u could resolve, i will appreciate if u let me have it)

Francis
0
Pero
Telerik team
answered on 15 Oct 2010, 05:14 PM
Hi Francis,

I am glad you resolved the issue yourself. When you have a problem that needs immediate response, please, besides opening a forum thread, open a new support ticket. Support tickets have higher priority, and you will receive an answer within 24 hours of opening the ticket.

So, in case you have any other questions, do not hesitate to open a support ticket.

Kind regards,
Pero
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
XmlHttpPanel
Asked by
Hakan
Top achievements
Rank 1
Answers by
Hakan
Top achievements
Rank 1
Pero
Telerik team
Francis Frank
Top achievements
Rank 1
Share this question
or