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

TextChangeEvent in RAdgrid control is not able to get the other controls id and Value

1 Answer 62 Views
Window
This is a migrated thread and some comments may be shown as answers.
pankaj
Top achievements
Rank 1
pankaj asked on 25 Sep 2008, 12:30 PM
 
First Thanks for the solution

But  i have the same problem with the RadTextBoxChanged event 
I did the same as maintion for the Dropdownlist but unable to work with the RadTextBoxChange event like not able the RadTextBoxChangedEventArgs e
To get the other controls like
radComboBox for Zip and state field 

protected void City_TextChanged(object sender, EventArgs e)
{

RadTextBox

txtCity = (RadTextBox)e; 

        GridEditableItem editedItem = ddlState.NamingContainer as GridEditableItem; 
        RadComboBox ddlZipeditedItem.FindControl("DropDownListZip") 


}

By this event not able to get the value like this, Showing error
 "Cannot convert type 'System.EventArgs' to 'Telerik.Web.UI.RadTextBox'"



Thanks With regards
Pankaj Tyagi

 

 void ddlSate_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e) 
    { 
        RadComboBox ddlState = (RadComboBox)o; 
        GridEditableItem editedItem = ddlState.NamingContainer as GridEditableItem; 
        RadComboBox ddlZipeditedItem.FindControl("DropDownListZip") as RadComboBox; 
    } 
 

telerik:RadGrid ID="rgStaffPhysicianDetails" EnableAJAX="False" runat="server" Skin ="WebBlue" width="100%"

 

AutoGenerateDeleteColumn ="True" AutoGenerateEditColumn ="True" GridLines="None" AutoGenerateColumns="False"

AllowPaging="True" OnItemDataBound="rgStaffPhysicianDetails_ItemDataBound" OnItemCommand="rgStaffPhysicianDetails_ItemCommand" >

 

<PagerStyle Mode="NumericPages"></PagerStyle>

 

<MasterTableView CommandItemDisplay= "Top" DataKeyNames="Prov_ID">

<

Columns >

 

<telerik:GridTemplateColumn HeaderText="Person Id" Visible="False" UniqueName="Per_ID">

<

ItemTemplate>

<

asp:Label ID="lblPersonId" Visible="false" runat="server" Text='<%# Eval("Prov_Per_IDSource.Per_ID")%>'></asp:Label>

 

<

asp:Label ID="lblProvID" Visible="false" runat="server" Text='<%# Eval("Prov_ID")%>'></asp:Label>

 

</

ItemTemplate>

</

telerik:GridTemplateColumn>

<telerik:GridTemplateColumn HeaderText="Physician Name" UniqueName="Per_FullName">

<

ItemTemplate>

<

asp:Label ID="lblStaffName" runat="server" Text='<%# Eval("Prov_Per_IDSource.Per_FullName")%>'></asp:Label>

 

</

ItemTemplate>

</

telerik:GridTemplateColumn>

</

Columns>

<

ExpandCollapseColumn Resizable="False" Visible="False"><HeaderStyle Width="20px" /></ExpandCollapseColumn><EditFormSettings EditFormType="Template"><PopUpSettings ScrollBars="None" /> <FormTemplate >

 

<

telerik:RadTextBox ID="RadTextBoxCity" runat="server" Width="230px" TabIndex="8" OnTextChanged="City_TextChanged"</telerik:RadTextBox>

 
<telerik:RadComboBox ID="DropDownListState" runat="server" Width="230px" TabIndex="9" EnableLoadOnDemand="True" HighlightTemplatedItems="True" MarkFirstMatch="True" AutoPostBack="true" OnSelectedIndexChanged="ddlState_SelectedIndexChanged" OnDataBound="ddlState_DataBound"><collapseanimation duration="200" type="OutQuint"></collapseanimation></telerik:RadComboBox>

<telerik:RadComboBox ID="DropDownListZip" runat="server" Width="230px" EnableLoadOnDemand="True" HighlightTemplatedItems="True" MarkFirstMatch="True" AutoPostBack="true" TabIndex="10">

 

</telerik:RadComboBox>

 

asp:Button id="cmdButton" ValidationGroup="Check" runat="server" Text='Update' TabIndex="23" CommandName='<%# (Container as GridItem).OwnerTableView.IsItemInserted ? "PerformInsert" : "Update" %>'>

 

</asp:Button><asp:Button id="Button1" runat="server" Text="Cancel" TabIndex="24" CausesValidation="False" CommandName="Cancel">

 

</asp:Button > </FormTemplate>

 

<EditColumn UniqueName="EditCommandColumn1">

 

</EditColumn>

 

</EditFormSettings>

<RowIndicatorColumn Visible="False">

 

<HeaderStyle Width="20px" />

 

</RowIndicatorColumn>

</

MasterTableView>

</telerik:RadGrid>

 exist in that.

But OnSelectedIndexChanged="ddlState_SelectedIndexChanged"  event dcleration in the ItemDataBound event of the Radgrid control like

ddlState.SelectedIndexChanged +=

new RadComboBoxSelectedIndexChangedEventHandler(this.ddlState_SelectedIndexChanged);

So my question is that I am unable to get Zip control like DropDownListZip in the ddlZip_SelectedIndexChanged() event 

Please sort out my problem i am unable to get the ID of the DropDownListZip ....


Thanks
Pankaj Tyagi





 

1 Answer, 1 is accepted

Sort by
0
Missing User
answered on 29 Sep 2008, 02:59 PM
Hi pankaj,

The TextChanged event handler receives two arguments:

   1. sender - The RadInput control whose value was just changed. This argument is of type object, but can be cast to the appropriate type.
   2. e - an System.EventArgs object.

use sender instead of e

protected void City_TextChanged(object sender, EventArgs e) 
 
    RadTextBox  txtCity = (RadTextBox)sender;  
    ... 
 






Greetings,
Plamen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Window
Asked by
pankaj
Top achievements
Rank 1
Answers by
Missing User
Share this question
or