9 Answers, 1 is accepted
0

Shinu
Top achievements
Rank 2
answered on 02 Feb 2012, 05:23 AM
Hello,
Make sure that you have set AutoPostBack property as true. Please elaborate your scenario if it doesn't help.
-Shinu.
Make sure that you have set AutoPostBack property as true. Please elaborate your scenario if it doesn't help.
-Shinu.
0

Chalam
Top achievements
Rank 1
answered on 02 Feb 2012, 06:24 AM
thanks for reply i have already put autopostback property as true for all comboboxes but it's not working,
this is my ASPX
<form id="form1" runat="server">
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
</telerik:RadScriptManager>
<telerik:RadWindowManager ID="RadWindowManager1" runat ="server" ></telerik:RadWindowManager>
<telerik:RadAjaxManager runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID ="RadComboBox1" EventName ="SelectedIndexChanged">
<UpdatedControls >
<%-- <telerik:AjaxUpdatedControl ControlID ="RadAjaxLoadingPanel1" />--%>
<telerik:AjaxUpdatedControl ControlID ="RadComboBom1" LoadingPanelID ="RadAjaxLoadingPanel1" />
<telerik:AjaxUpdatedControl ControlID ="RadComboBox2" LoadingPanelID="RadAjaxLoadingPanel1" />
<telerik:AjaxUpdatedControl ControlID ="Button1" />
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID ="Button1">
<UpdatedControls >
<telerik:AjaxUpdatedControl ControlID ="Button1" LoadingPanelID ="RadAjaxLoadingPanel1" />
<telerik:AjaxUpdatedControl ControlID ="RadGrid1" />
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID ="RadGrid1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID ="RadGrid1" LoadingPanelID ="RadAjaxLoadingPanel1" />
<telerik:AjaxUpdatedControl ControlID ="Button1" />
<telerik:AjaxUpdatedControl ControlID ="RadComboBox2" />
<telerik:AjaxUpdatedControl ControlID ="RadTextBox2" />
<telerik:AjaxUpdatedControl ControlID ="RadTextBox3" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Vista" IsSticky ="True" CssClass ="loadingpanel">
<%--<img src="images/loading.gif" alt="" />--%>
</telerik:RadAjaxLoadingPanel>
<table class="style1">
<tr>
<td>
<telerik:RadComboBox ID="RadComboBox1" Runat="server"
AutoPostBack="True" MarkFirstMatch="True" Width="204px" DropDownWidth="250px" Height="200px"
Skin="Web20" AppendDataBoundItems="True" EnableLoadOnDemand="True">
</telerik:RadComboBox>
</td>
</tr>
<tr>
<td class="style4">
</td>
<td class="style2">
Name</td>
<td>
<telerik:RadComboBox ID="RadComboBox2" Runat="server"
AutoPostBack="True" MarkFirstMatch="True" Width="204px" DropDownWidth="250px" Height="200px"
Skin="Web20" AppendDataBoundItems="True" EnableLoadOnDemand="True">
</telerik:RadComboBox>
</td>
</tr>
<tr>
<td class="style4">
</td>
<td class="style2">
Age</td>
<td>
<telerik:RadTextBox ID="RadTextBox2" Runat="server" Width="180px">
</telerik:RadTextBox>
</td>
</tr>
<tr>
<td class="style4">
</td>
<td class="style2">
Address</td>
<td>
<telerik:RadTextBox ID="RadTextBox3" Runat="server" Width="180px">
</telerik:RadTextBox>
</td>
</tr>
<tr>
<td class="style4">
</td>
<td class="style2">
</td>
<td>
<asp:Button ID="Button1" runat="server" Text="Search" />
</td>
</tr>
<tr>
<td class="style3" colspan="3">
<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False"
GridLines="None" PageSize="7"
Skin="Web20" Width="949px" AllowPaging="True"
AllowFilteringByColumn="True" AllowSorting="True" ShowGroupPanel="True">
<MasterTableView >
<Columns >
<telerik:GridEditCommandColumn ButtonType ="ImageButton" HeaderText ="Edit" >
</telerik:GridEditCommandColumn>
<telerik:GridBoundColumn DataField ="id" HeaderText="id" UniqueName="id" >
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Name" DataField ="name" UniqueName="name" >
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="pwd" UniqueName="pwd" DataField ="pwd" >
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="mobile" UniqueName="mobile" DataField ="mobile">
</telerik:GridBoundColumn>
</Columns>
<EditFormSettings>
<EditColumn UniqueName="EditCommandColumn"></EditColumn>
</EditFormSettings>
</MasterTableView>
<ClientSettings AllowDragToGroup="True" EnableRowHoverStyle="True">
<Selecting AllowRowSelect="true" />
</ClientSettings>
</telerik:RadGrid>
</td>
</tr>
</table>
</form>
without using the Ajax Settings all are working fine but after using Ajax Settings the combo boxes are not populate values
Hear My .VB is
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Page.IsPostBack <> True Then
RadComboBox1.Text = "Select"
loadcombo()
RadGrid1.Visible = False
End If
End Sub
Protected Sub loadgrid()
con.Open()
Dim cmd As New MySqlCommand("select id,name,pwd,mobile from employee where id='" + RadComboBox1.SelectedItem.Text + "'", con)
Dim da As New MySqlDataAdapter(cmd)
Dim ds As New DataSet
da.Fill(ds)
RadGrid1.DataSource = ds
RadGrid1.DataBind()
RadGrid1.Visible = True
con.Close()
End Sub
Protected Sub loadcombo()
System.Threading.Thread.Sleep(2000)
con.Open()
Dim cd As New MySqlCommand("select distinct id from employee ", con)
Dim adp As New MySqlDataAdapter(cd)
Dim ds As New DataSet
adp.Fill(ds)
RadComboBox1.DataSource = ds
RadComboBox1.DataTextField = "id"
RadComboBox1.DataValueField = "id"
RadComboBox1.DataBind()
con.Close()
End Sub
Protected Sub loadcombo1()
con.Open()
Dim combo As New MySqlCommand("select name from employee where id='" + RadComboBox1.SelectedItem.Text + "'", con)
Dim ad1 As New MySqlDataAdapter(combo)
Dim ds1 As New DataSet
ad1.Fill(ds1)
RadComboBox2.DataSource = ds1
RadComboBox2.Items.Clear()
RadComboBox2.DataTextField = "name"
RadComboBox2.DataValueField = "name"
RadComboBox2.DataBind()
con.Close()
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
System.Threading.Thread.Sleep(2000)
If RadComboBox1.SelectedIndex > 0 Then
loadgrid()
Else
con.Open()
Dim cm As New MySqlCommand("select * from employee where id='" + RadComboBox1.SelectedItem.Text + "'", con)
Dim dap As New MySqlDataAdapter(cm)
Dim dss As New DataSet
dap.Fill(dss)
RadGrid1.DataSource = dss
RadGrid1.DataBind()
RadGrid1.Visible = True
con.Close()
End If
End Sub
Protected Sub RadGrid1_EditCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.EditCommand
System.Threading.Thread.Sleep(2000)
e.Item.Edit = False
Dim index As Integer = e.Item.ItemIndex
Session("ID") = RadGrid1.Items(index).Item("id").Text
RadComboBox1.Text = RadGrid1.Items(index).Item("id").Text.Replace(" ", "")
RadComboBox2.Text = RadGrid1.Items(index).Item("name").Text.Replace(" ", "")
RadTextBox2.Text = RadGrid1.Items(index).Item("pwd").Text.Replace(" ", "")
RadTextBox3.Text = RadGrid1.Items(index).Item("mobile").Text.Replace(" ", "")
End Sub
Protected Sub RadComboBox1_SelectedIndexChanged(o As Object, e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs) Handles RadComboBox1.SelectedIndexChanged
System.Threading.Thread.Sleep(2000)
RadComboBox2.Text = "Select"
loadcombo1()
End Sub
Protected Sub RadGrid1_NeedDataSource(source As Object, e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource
System.Threading.Thread.Sleep(1000)
If Not Session("GRDSEARCH") Is Nothing Then
RadGrid1.DataSource = CType(Session("GRDSEARCH"), DataTable)
End If
End Sub
End Class
so plz help me
thanks in advance
this is my ASPX
<form id="form1" runat="server">
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
</telerik:RadScriptManager>
<telerik:RadWindowManager ID="RadWindowManager1" runat ="server" ></telerik:RadWindowManager>
<telerik:RadAjaxManager runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID ="RadComboBox1" EventName ="SelectedIndexChanged">
<UpdatedControls >
<%-- <telerik:AjaxUpdatedControl ControlID ="RadAjaxLoadingPanel1" />--%>
<telerik:AjaxUpdatedControl ControlID ="RadComboBom1" LoadingPanelID ="RadAjaxLoadingPanel1" />
<telerik:AjaxUpdatedControl ControlID ="RadComboBox2" LoadingPanelID="RadAjaxLoadingPanel1" />
<telerik:AjaxUpdatedControl ControlID ="Button1" />
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID ="Button1">
<UpdatedControls >
<telerik:AjaxUpdatedControl ControlID ="Button1" LoadingPanelID ="RadAjaxLoadingPanel1" />
<telerik:AjaxUpdatedControl ControlID ="RadGrid1" />
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID ="RadGrid1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID ="RadGrid1" LoadingPanelID ="RadAjaxLoadingPanel1" />
<telerik:AjaxUpdatedControl ControlID ="Button1" />
<telerik:AjaxUpdatedControl ControlID ="RadComboBox2" />
<telerik:AjaxUpdatedControl ControlID ="RadTextBox2" />
<telerik:AjaxUpdatedControl ControlID ="RadTextBox3" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Vista" IsSticky ="True" CssClass ="loadingpanel">
<%--<img src="images/loading.gif" alt="" />--%>
</telerik:RadAjaxLoadingPanel>
<table class="style1">
<tr>
<td>
<telerik:RadComboBox ID="RadComboBox1" Runat="server"
AutoPostBack="True" MarkFirstMatch="True" Width="204px" DropDownWidth="250px" Height="200px"
Skin="Web20" AppendDataBoundItems="True" EnableLoadOnDemand="True">
</telerik:RadComboBox>
</td>
</tr>
<tr>
<td class="style4">
</td>
<td class="style2">
Name</td>
<td>
<telerik:RadComboBox ID="RadComboBox2" Runat="server"
AutoPostBack="True" MarkFirstMatch="True" Width="204px" DropDownWidth="250px" Height="200px"
Skin="Web20" AppendDataBoundItems="True" EnableLoadOnDemand="True">
</telerik:RadComboBox>
</td>
</tr>
<tr>
<td class="style4">
</td>
<td class="style2">
Age</td>
<td>
<telerik:RadTextBox ID="RadTextBox2" Runat="server" Width="180px">
</telerik:RadTextBox>
</td>
</tr>
<tr>
<td class="style4">
</td>
<td class="style2">
Address</td>
<td>
<telerik:RadTextBox ID="RadTextBox3" Runat="server" Width="180px">
</telerik:RadTextBox>
</td>
</tr>
<tr>
<td class="style4">
</td>
<td class="style2">
</td>
<td>
<asp:Button ID="Button1" runat="server" Text="Search" />
</td>
</tr>
<tr>
<td class="style3" colspan="3">
<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False"
GridLines="None" PageSize="7"
Skin="Web20" Width="949px" AllowPaging="True"
AllowFilteringByColumn="True" AllowSorting="True" ShowGroupPanel="True">
<MasterTableView >
<Columns >
<telerik:GridEditCommandColumn ButtonType ="ImageButton" HeaderText ="Edit" >
</telerik:GridEditCommandColumn>
<telerik:GridBoundColumn DataField ="id" HeaderText="id" UniqueName="id" >
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Name" DataField ="name" UniqueName="name" >
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="pwd" UniqueName="pwd" DataField ="pwd" >
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="mobile" UniqueName="mobile" DataField ="mobile">
</telerik:GridBoundColumn>
</Columns>
<EditFormSettings>
<EditColumn UniqueName="EditCommandColumn"></EditColumn>
</EditFormSettings>
</MasterTableView>
<ClientSettings AllowDragToGroup="True" EnableRowHoverStyle="True">
<Selecting AllowRowSelect="true" />
</ClientSettings>
</telerik:RadGrid>
</td>
</tr>
</table>
</form>
without using the Ajax Settings all are working fine but after using Ajax Settings the combo boxes are not populate values
Hear My .VB is
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Page.IsPostBack <> True Then
RadComboBox1.Text = "Select"
loadcombo()
RadGrid1.Visible = False
End If
End Sub
Protected Sub loadgrid()
con.Open()
Dim cmd As New MySqlCommand("select id,name,pwd,mobile from employee where id='" + RadComboBox1.SelectedItem.Text + "'", con)
Dim da As New MySqlDataAdapter(cmd)
Dim ds As New DataSet
da.Fill(ds)
RadGrid1.DataSource = ds
RadGrid1.DataBind()
RadGrid1.Visible = True
con.Close()
End Sub
Protected Sub loadcombo()
System.Threading.Thread.Sleep(2000)
con.Open()
Dim cd As New MySqlCommand("select distinct id from employee ", con)
Dim adp As New MySqlDataAdapter(cd)
Dim ds As New DataSet
adp.Fill(ds)
RadComboBox1.DataSource = ds
RadComboBox1.DataTextField = "id"
RadComboBox1.DataValueField = "id"
RadComboBox1.DataBind()
con.Close()
End Sub
Protected Sub loadcombo1()
con.Open()
Dim combo As New MySqlCommand("select name from employee where id='" + RadComboBox1.SelectedItem.Text + "'", con)
Dim ad1 As New MySqlDataAdapter(combo)
Dim ds1 As New DataSet
ad1.Fill(ds1)
RadComboBox2.DataSource = ds1
RadComboBox2.Items.Clear()
RadComboBox2.DataTextField = "name"
RadComboBox2.DataValueField = "name"
RadComboBox2.DataBind()
con.Close()
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
System.Threading.Thread.Sleep(2000)
If RadComboBox1.SelectedIndex > 0 Then
loadgrid()
Else
con.Open()
Dim cm As New MySqlCommand("select * from employee where id='" + RadComboBox1.SelectedItem.Text + "'", con)
Dim dap As New MySqlDataAdapter(cm)
Dim dss As New DataSet
dap.Fill(dss)
RadGrid1.DataSource = dss
RadGrid1.DataBind()
RadGrid1.Visible = True
con.Close()
End If
End Sub
Protected Sub RadGrid1_EditCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.EditCommand
System.Threading.Thread.Sleep(2000)
e.Item.Edit = False
Dim index As Integer = e.Item.ItemIndex
Session("ID") = RadGrid1.Items(index).Item("id").Text
RadComboBox1.Text = RadGrid1.Items(index).Item("id").Text.Replace(" ", "")
RadComboBox2.Text = RadGrid1.Items(index).Item("name").Text.Replace(" ", "")
RadTextBox2.Text = RadGrid1.Items(index).Item("pwd").Text.Replace(" ", "")
RadTextBox3.Text = RadGrid1.Items(index).Item("mobile").Text.Replace(" ", "")
End Sub
Protected Sub RadComboBox1_SelectedIndexChanged(o As Object, e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs) Handles RadComboBox1.SelectedIndexChanged
System.Threading.Thread.Sleep(2000)
RadComboBox2.Text = "Select"
loadcombo1()
End Sub
Protected Sub RadGrid1_NeedDataSource(source As Object, e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource
System.Threading.Thread.Sleep(1000)
If Not Session("GRDSEARCH") Is Nothing Then
RadGrid1.DataSource = CType(Session("GRDSEARCH"), DataTable)
End If
End Sub
End Class
so plz help me
thanks in advance
0
Hi,
The issues might be caused by the syntax error
I hope this helps.
Greetings,
Ivana
the Telerik team
The issues might be caused by the syntax error
RadComboBom1
which should be RadComboBox1
:<
telerik:RadAjaxManager
ID
=
"RadAjaxManager1"
runat
=
"server"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"RadComboBox1"
EventName
=
"SelectedIndexChanged"
>
<
UpdatedControls
>
<%-- <
telerik:AjaxUpdatedControl
ControlID
=
"RadAjaxLoadingPanel1"
/>--%>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadComboBom1"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
/>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadComboBox2"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
/>
<
telerik:AjaxUpdatedControl
ControlID
=
"Button1"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
<
telerik:AjaxSetting
AjaxControlID
=
"Button1"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"Button1"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
/>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadGrid1"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
<
telerik:AjaxSetting
AjaxControlID
=
"RadGrid1"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadGrid1"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
/>
<
telerik:AjaxUpdatedControl
ControlID
=
"Button1"
/>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadComboBox2"
/>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadTextBox2"
/>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadTextBox3"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManager
>
<
telerik:RadComboBox
ID
=
"RadComboBox1"
runat
=
"server"
AutoPostBack
=
"True"
MarkFirstMatch
=
"True"
Width
=
"204px"
DropDownWidth
=
"250px"
Height
=
"200px"
Skin
=
"Web20"
AppendDataBoundItems
=
"True"
EnableLoadOnDemand
=
"True"
>
</
telerik:RadComboBox
>
I hope this helps.
Greetings,
Ivana
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0

Chalam
Top achievements
Rank 1
answered on 07 Feb 2012, 12:48 PM
Thanks for reply
i have modify that ID but still it's not working once again i have to explain my problem is the ComboBox2 is loads with some data based on selecting ComboBox1 with showing progressbar
Hear My SourceCode is
<form id="form1" runat="server">
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
</telerik:RadScriptManager>
<telerik:RadWindowManager ID="RadWindowManager1" runat ="server" ></telerik:RadWindowManager>
<telerik:RadAjaxManager runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadComboBox1" EventName ="SelectedIndexChanged">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadAjaxLoadingPanel1" />
<telerik:AjaxUpdatedControl ControlID="RadComboBox1"
LoadingPanelID="RadAjaxLoadingPanel1" />
<telerik:AjaxUpdatedControl ControlID="RadComboBox2"
LoadingPanelID="RadAjaxLoadingPanel1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Vista" IsSticky ="True" CssClass ="loadingpanel">
</telerik:RadAjaxLoadingPanel>
<table class="style1">
<tr>
<td class="style4">
</td>
<td class="style2">
Id</td>
<td>
<telerik:RadComboBox ID="RadComboBox1" Runat="server"
AutoPostBack="True" MarkFirstMatch="True" Width="204px" DropDownWidth="250px" Height="200px"
Skin="Web20" AppendDataBoundItems="True" EnableLoadOnDemand="True">
</telerik:RadComboBox>
</td>
</tr>
<tr>
<td class="style4">
</td>
<td class="style2">
Name</td>
<td>
<telerik:RadComboBox ID="RadComboBox2" Runat="server"
AutoPostBack="True" MarkFirstMatch="True" Width="204px" DropDownWidth="250px" Height="200px"
Skin="Web20" AppendDataBoundItems="True" >
</telerik:RadComboBox>
</td>
</tr>
<tr>
<td class="style4">
</td>
<td class="style2">
Age</td>
<td>
<telerik:RadTextBox ID="RadTextBox2" Runat="server" Width="180px">
</telerik:RadTextBox>
</td>
</tr>
<tr>
<td class="style4">
</td>
<td class="style2">
Address</td>
<td>
<telerik:RadTextBox ID="RadTextBox3" Runat="server" Width="180px">
</telerik:RadTextBox>
</td>
</tr>
<tr>
<td class="style4">
</td>
<td class="style2">
</td>
<td>
<asp:Button ID="Button1" runat="server" Text="Search" />
</td>
</tr>
<tr>
<td class="style3" colspan="3">
<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False"
GridLines="None" PageSize="7"
Skin="Web20" Width="949px" AllowPaging="True"
AllowFilteringByColumn="True" AllowSorting="True" ShowGroupPanel="True">
<MasterTableView >
<Columns >
<telerik:GridEditCommandColumn ButtonType ="ImageButton" HeaderText ="Edit" >
</telerik:GridEditCommandColumn>
<telerik:GridBoundColumn DataField ="id" HeaderText="id" UniqueName="id" >
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Name" DataField ="name" UniqueName="name" >
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="pwd" UniqueName="pwd" DataField ="pwd" >
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="mobile" UniqueName="mobile" DataField ="mobile">
</telerik:GridBoundColumn>
</Columns>
<EditFormSettings>
<EditColumn UniqueName="EditCommandColumn"></EditColumn>
</EditFormSettings>
</MasterTableView>
<ClientSettings AllowDragToGroup="True" EnableRowHoverStyle="True">
<Selecting AllowRowSelect="true" />
</ClientSettings>
</telerik:RadGrid>
</td>
</tr>
</table>
</form>
Hear My VB is
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Page.IsPostBack <> True Then
RadComboBox1.Text = "Select"
loadcombo()
RadGrid1.Visible = False
End If
End Sub
'Protected Sub RadGrid1_PreRender(ByVal sender As Object, ByVal e As EventArgs) Handles RadGrid1.PreRender
' If RadGrid1.SelectedItems.Count = 0 Then
' RadGrid1.Items(0).Selected = True
' End If
'End Sub
'Protected Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender
' If RadComboBox1.SelectedIndex = 0 Then
' RadComboBox1.SelectedIndex.
' End If
'End Sub
Protected Sub loadgrid()
con.Open()
Dim cmd As New MySqlCommand("select id,name,pwd,mobile from employee where id='" + RadComboBox1.SelectedItem.Text + "'", con)
Dim da As New MySqlDataAdapter(cmd)
Dim ds As New DataSet
da.Fill(ds)
Session("Chalam") = ds
RadGrid1.DataSource = ds
RadGrid1.DataBind()
RadGrid1.Visible = True
con.Close()
End Sub
Protected Sub loadcombo()
System.Threading.Thread.Sleep(2000)
con.Open()
Dim cd As New MySqlCommand("select distinct id from employee ", con)
Dim adp As New MySqlDataAdapter(cd)
Dim ds As New DataSet
adp.Fill(ds)
RadComboBox1.DataSource = ds
RadComboBox1.DataTextField = "id"
RadComboBox1.DataValueField = "id"
RadComboBox1.DataBind()
con.Close()
End Sub
Protected Sub loadcombo1()
con.Open()
Dim combo As New MySqlCommand("select name from employee where id='" + RadComboBox1.SelectedItem.Text + "'", con)
Dim ad1 As New MySqlDataAdapter(combo)
Dim ds1 As New DataSet
ad1.Fill(ds1)
RadComboBox2.DataSource = ds1
RadComboBox2.Items.Clear()
RadComboBox2.DataTextField = "name"
RadComboBox2.DataValueField = "name"
RadComboBox2.DataBind()
con.Close()
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
System.Threading.Thread.Sleep(2000)
If RadComboBox1.SelectedIndex > 0 Then
loadgrid()
Else
con.Open()
Dim cm As New MySqlCommand("select * from employee where id='" + RadComboBox1.SelectedItem.Text + "'", con)
Dim dap As New MySqlDataAdapter(cm)
Dim dss As New DataSet
dap.Fill(dss)
RadGrid1.DataSource = dss
RadGrid1.DataBind()
RadGrid1.Visible = True
con.Close()
End If
End Sub
Protected Sub RadGrid1_EditCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.EditCommand
System.Threading.Thread.Sleep(2000)
e.Item.Edit = False
Dim index As Integer = e.Item.ItemIndex
RadComboBox1.Text = RadGrid1.Items(index).Item("id").Text.Replace(" ", "")
RadComboBox2.Text = RadGrid1.Items(index).Item("name").Text.Replace(" ", "")
RadTextBox2.Text = RadGrid1.Items(index).Item("pwd").Text.Replace(" ", "")
RadTextBox3.Text = RadGrid1.Items(index).Item("mobile").Text.Replace(" ", "")
End Sub
Protected Sub RadComboBox1_SelectedIndexChanged(o As Object, e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs) Handles RadComboBox1.SelectedIndexChanged
System.Threading.Thread.Sleep(2000)
RadComboBox2.Text = "Select"
RadTextBox2.Text = ""
RadTextBox3.Text = ""
loadcombo1()
End Sub
Protected Sub RadGrid1_NeedDataSource(source As Object, e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource
System.Threading.Thread.Sleep(1000)
If Not Session("Chalam") Is Nothing Then
RadGrid1.DataSource = CType(Session("Chalam"), DataSet)
End If
End Sub
End Class
Plz help me
Thanks in advance
i have modify that ID but still it's not working once again i have to explain my problem is the ComboBox2 is loads with some data based on selecting ComboBox1 with showing progressbar
Hear My SourceCode is
<form id="form1" runat="server">
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
</telerik:RadScriptManager>
<telerik:RadWindowManager ID="RadWindowManager1" runat ="server" ></telerik:RadWindowManager>
<telerik:RadAjaxManager runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadComboBox1" EventName ="SelectedIndexChanged">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadAjaxLoadingPanel1" />
<telerik:AjaxUpdatedControl ControlID="RadComboBox1"
LoadingPanelID="RadAjaxLoadingPanel1" />
<telerik:AjaxUpdatedControl ControlID="RadComboBox2"
LoadingPanelID="RadAjaxLoadingPanel1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Vista" IsSticky ="True" CssClass ="loadingpanel">
</telerik:RadAjaxLoadingPanel>
<table class="style1">
<tr>
<td class="style4">
</td>
<td class="style2">
Id</td>
<td>
<telerik:RadComboBox ID="RadComboBox1" Runat="server"
AutoPostBack="True" MarkFirstMatch="True" Width="204px" DropDownWidth="250px" Height="200px"
Skin="Web20" AppendDataBoundItems="True" EnableLoadOnDemand="True">
</telerik:RadComboBox>
</td>
</tr>
<tr>
<td class="style4">
</td>
<td class="style2">
Name</td>
<td>
<telerik:RadComboBox ID="RadComboBox2" Runat="server"
AutoPostBack="True" MarkFirstMatch="True" Width="204px" DropDownWidth="250px" Height="200px"
Skin="Web20" AppendDataBoundItems="True" >
</telerik:RadComboBox>
</td>
</tr>
<tr>
<td class="style4">
</td>
<td class="style2">
Age</td>
<td>
<telerik:RadTextBox ID="RadTextBox2" Runat="server" Width="180px">
</telerik:RadTextBox>
</td>
</tr>
<tr>
<td class="style4">
</td>
<td class="style2">
Address</td>
<td>
<telerik:RadTextBox ID="RadTextBox3" Runat="server" Width="180px">
</telerik:RadTextBox>
</td>
</tr>
<tr>
<td class="style4">
</td>
<td class="style2">
</td>
<td>
<asp:Button ID="Button1" runat="server" Text="Search" />
</td>
</tr>
<tr>
<td class="style3" colspan="3">
<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False"
GridLines="None" PageSize="7"
Skin="Web20" Width="949px" AllowPaging="True"
AllowFilteringByColumn="True" AllowSorting="True" ShowGroupPanel="True">
<MasterTableView >
<Columns >
<telerik:GridEditCommandColumn ButtonType ="ImageButton" HeaderText ="Edit" >
</telerik:GridEditCommandColumn>
<telerik:GridBoundColumn DataField ="id" HeaderText="id" UniqueName="id" >
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Name" DataField ="name" UniqueName="name" >
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="pwd" UniqueName="pwd" DataField ="pwd" >
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="mobile" UniqueName="mobile" DataField ="mobile">
</telerik:GridBoundColumn>
</Columns>
<EditFormSettings>
<EditColumn UniqueName="EditCommandColumn"></EditColumn>
</EditFormSettings>
</MasterTableView>
<ClientSettings AllowDragToGroup="True" EnableRowHoverStyle="True">
<Selecting AllowRowSelect="true" />
</ClientSettings>
</telerik:RadGrid>
</td>
</tr>
</table>
</form>
Hear My VB is
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Page.IsPostBack <> True Then
RadComboBox1.Text = "Select"
loadcombo()
RadGrid1.Visible = False
End If
End Sub
'Protected Sub RadGrid1_PreRender(ByVal sender As Object, ByVal e As EventArgs) Handles RadGrid1.PreRender
' If RadGrid1.SelectedItems.Count = 0 Then
' RadGrid1.Items(0).Selected = True
' End If
'End Sub
'Protected Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender
' If RadComboBox1.SelectedIndex = 0 Then
' RadComboBox1.SelectedIndex.
' End If
'End Sub
Protected Sub loadgrid()
con.Open()
Dim cmd As New MySqlCommand("select id,name,pwd,mobile from employee where id='" + RadComboBox1.SelectedItem.Text + "'", con)
Dim da As New MySqlDataAdapter(cmd)
Dim ds As New DataSet
da.Fill(ds)
Session("Chalam") = ds
RadGrid1.DataSource = ds
RadGrid1.DataBind()
RadGrid1.Visible = True
con.Close()
End Sub
Protected Sub loadcombo()
System.Threading.Thread.Sleep(2000)
con.Open()
Dim cd As New MySqlCommand("select distinct id from employee ", con)
Dim adp As New MySqlDataAdapter(cd)
Dim ds As New DataSet
adp.Fill(ds)
RadComboBox1.DataSource = ds
RadComboBox1.DataTextField = "id"
RadComboBox1.DataValueField = "id"
RadComboBox1.DataBind()
con.Close()
End Sub
Protected Sub loadcombo1()
con.Open()
Dim combo As New MySqlCommand("select name from employee where id='" + RadComboBox1.SelectedItem.Text + "'", con)
Dim ad1 As New MySqlDataAdapter(combo)
Dim ds1 As New DataSet
ad1.Fill(ds1)
RadComboBox2.DataSource = ds1
RadComboBox2.Items.Clear()
RadComboBox2.DataTextField = "name"
RadComboBox2.DataValueField = "name"
RadComboBox2.DataBind()
con.Close()
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
System.Threading.Thread.Sleep(2000)
If RadComboBox1.SelectedIndex > 0 Then
loadgrid()
Else
con.Open()
Dim cm As New MySqlCommand("select * from employee where id='" + RadComboBox1.SelectedItem.Text + "'", con)
Dim dap As New MySqlDataAdapter(cm)
Dim dss As New DataSet
dap.Fill(dss)
RadGrid1.DataSource = dss
RadGrid1.DataBind()
RadGrid1.Visible = True
con.Close()
End If
End Sub
Protected Sub RadGrid1_EditCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.EditCommand
System.Threading.Thread.Sleep(2000)
e.Item.Edit = False
Dim index As Integer = e.Item.ItemIndex
RadComboBox1.Text = RadGrid1.Items(index).Item("id").Text.Replace(" ", "")
RadComboBox2.Text = RadGrid1.Items(index).Item("name").Text.Replace(" ", "")
RadTextBox2.Text = RadGrid1.Items(index).Item("pwd").Text.Replace(" ", "")
RadTextBox3.Text = RadGrid1.Items(index).Item("mobile").Text.Replace(" ", "")
End Sub
Protected Sub RadComboBox1_SelectedIndexChanged(o As Object, e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs) Handles RadComboBox1.SelectedIndexChanged
System.Threading.Thread.Sleep(2000)
RadComboBox2.Text = "Select"
RadTextBox2.Text = ""
RadTextBox3.Text = ""
loadcombo1()
End Sub
Protected Sub RadGrid1_NeedDataSource(source As Object, e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource
System.Threading.Thread.Sleep(1000)
If Not Session("Chalam") Is Nothing Then
RadGrid1.DataSource = CType(Session("Chalam"), DataSet)
End If
End Sub
End Class
Plz help me
Thanks in advance
0
Hi,
I have closed your second thread concerning this matter. To avoid duplications and misunderstanding I would suggest to continue our conversation here.
As for the issue you experience, take a look at the attached sample showing that SelectedIndexChanged event is fired as it should when the index is changed.
If you also want to update the RadDataGrid when a button is clicked, you should add the following settings to the RadAjaxManager:
Also, what is the version of our controls that you are using?
Greetings,
Ivana
the Telerik team
I have closed your second thread concerning this matter. To avoid duplications and misunderstanding I would suggest to continue our conversation here.
As for the issue you experience, take a look at the attached sample showing that SelectedIndexChanged event is fired as it should when the index is changed.
If you also want to update the RadDataGrid when a button is clicked, you should add the following settings to the RadAjaxManager:
<
telerik:RadAjaxManager
ID
=
"RadAjaxManager1"
runat
=
"server"
EnableAJAX
=
"false"
>
<
AjaxSettings
>
<%--<
telerik:AjaxSetting
AjaxControlID
=
"RadComboBox1"
EventName
=
"OnSelectedIndexChanged"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadComboBox1"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
/>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadComboBox2"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>--%>
<
telerik:AjaxSetting
AjaxControlID
=
"Button1"
EventName
=
"OnSelectedIndexChanged"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadGrid1"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManager
>
Also, what is the version of our controls that you are using?
Greetings,
Ivana
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0

Chalam
Top achievements
Rank 1
answered on 14 Feb 2012, 06:14 AM
Thanks for reply
I want to show progressbar when selecting first combobox and load second combobox after progressbar stoped
and my Rad controls Version is Version 2009.2.701.20 from Telerik .NET component
and i am using MVS 2010
Thanks in advance
I want to show progressbar when selecting first combobox and load second combobox after progressbar stoped
and my Rad controls Version is Version 2009.2.701.20 from Telerik .NET component
and i am using MVS 2010
Thanks in advance
0
Hello,
Try to use the technique used in the following online demo: Related RadComboBoxes. It shows related RadComboBoxes scenario were the items are requested on demand.
The Country RadComboBox makes a request for its items when the selected index of the Continent RadComboBox is changed. It uses the client event OnClientSelectedIndexChanged of Continent RadComboBox where the requestItems() method for Country
You could refer to the implementation of the aforementioned online demo for more information and the online documentation.
Kind regards,
Ivana
the Telerik team
Try to use the technique used in the following online demo: Related RadComboBoxes. It shows related RadComboBoxes scenario were the items are requested on demand.
The Country RadComboBox makes a request for its items when the selected index of the Continent RadComboBox is changed. It uses the client event OnClientSelectedIndexChanged of Continent RadComboBox where the requestItems() method for Country
RadComboBox is called and the request is handled in the server-side ItemsRequested event.You could refer to the implementation of the aforementioned online demo for more information and the online documentation.
Kind regards,
Ivana
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0

Chalam
Top achievements
Rank 1
answered on 20 Feb 2012, 10:38 AM
Thanks for replay
my requirement is to show progressbar through Ajaxsettings in RadAjaxmanager when i select first combobox
plz help me
thanks in advance
my requirement is to show progressbar through Ajaxsettings in RadAjaxmanager when i select first combobox
plz help me
thanks in advance
0
Hello,
Attached is an example which demonstrates how to show the AjaxLoadingPanel when the selected index of the first RadComboBox is changed.
To learn more about RadAjax you can refer to its online documentation:
[http://www.telerik.com/help/aspnet-ajax/ajx-how-it-works.html].
I hope this helps.
Kind regards,
Ivana
the Telerik team
Attached is an example which demonstrates how to show the AjaxLoadingPanel when the selected index of the first RadComboBox is changed.
To learn more about RadAjax you can refer to its online documentation:
[http://www.telerik.com/help/aspnet-ajax/ajx-how-it-works.html].
I hope this helps.
Kind regards,
Ivana
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.