I've built an ASP.NET composite control which includes several asp label controls, two textbox controls and a button control. The composite control functions perfectly - without having any of the above controls ajaxified - in a parent page that already has a RadAjaxManager.
Now I want to ajaxify the composite control. I followed the various examples and sample code, but no matter which way I arrange the code, when I ajaxify the the button, two text boxes and a label in the composite control and click the button, I always get alternating full postback and asynchronous (partial) postback. (So I get the effect I want every other button click.)
// in CreateChildControls I added:
RadAjaxManager objTelerikAjaxManager = RadAjaxManager.GetCurrent(Page);
if (objTelerikAjaxManager == null)
{
objTelerikAjaxManager = new RadAjaxManager();
objTelerikAjaxManager.ID = "RadAjaxManager1";
Controls.Add(objTelerikAjaxManager);
}
.
.
// create controls and add to collection, then:
.
.
objTelerikAjaxManager.AjaxSettings.AddAjaxSetting(objFELoginControlButtonLogin, objFELoginControlButtonLogin);
objTelerikAjaxManager.AjaxSettings.AddAjaxSetting(objFELoginControlButtonLogin, objFELoginControlLabelMessage);
objTelerikAjaxManager.AjaxSettings.AddAjaxSetting(objFELoginControlButtonLogin, objFELoginControlTextBoxUser);
objTelerikAjaxManager.AjaxSettings.AddAjaxSetting(objFELoginControlButtonLogin, objFELoginControlTextBoxAppID);
What am I missing and what should I check? Is there an alternative recommendation for placing the above code blocks?
Thanks
<telerik:GridTemplateColumn DataField="bldgstreet1" FilterControlAltText="Filter address column" HeaderText="Address" SortExpression="address" UniqueName="addressTemplate">
<EditItemTemplate>
<asp:TextBox ID="address1" runat="server" Text='<%# Bind("bldgstreet1") %>'></asp:TextBox><br />
<asp:TextBox ID="address2" runat="server" Text='<%# Bind("bldgstreet2") %>'></asp:TextBox>
</EditItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="address1" runat="server" Text='<%# Bind("bldgstreet1") %>'></asp:TextBox><br />
<asp:TextBox ID="address2" runat="server" Text='<%# Bind("bldgstreet2") %>'></asp:TextBox>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="addressLabel" runat="server" Text='<%# Eval("bldgstreet1") + " " + Eval("bldgstreet2") %>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn DataField="bldgcity" FilterControlAltText="Filter bldgcity column" HeaderText="City" SortExpression="bldgcity" UniqueName="bldgcity">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="bldgstate" FilterControlAltText="Filter bldgstate column" HeaderText="State" SortExpression="bldgstate" UniqueName="bldgstate">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="bldgzip" FilterControlAltText="Filter bldgzip column" HeaderText="Zip" SortExpression="bldgzip" UniqueName="bldgzip">
</telerik:GridBoundColumn>
protected void CertifyAddressImageButton_Click(object sender, ImageClickEventArgs e)
{
foreach (GridEditableItem item in gdvBuilding.EditItems)
{
string bldgname = ((TableCell)item["bldgname"]).Text.Trim();
Debug.WriteLine("bldgname=" + bldgname);
string zip = ((TableCell)item["bldgzip"]).Text.Trim();
Debug.WriteLine("zip=" + zip);
TableCell cell = item["addressTemplate"];
string address1 = (cell.Controls[0] as TextBox).Text;
// This also doesn't work
// string address1 = (item.FindControl("address1") as TextBox).Text;
// Debug.WriteLine("address=" + address1);
Debug.WriteLine("address=" + address1);
}
//CertifyAddress();
}
Hi Telerik support,
My client is using telerik control, version 2012...
We are using RadRotator. I want to get the current showing index. If I retrieve index like:
function OnClientItemShown( sender, eventArgs)
{
alert( eventArgs.get_item().get_index());
}
it does not always give the right value. For example, if I have 4 items, showing one item per screen. When it start rotating, the index for the first 3 times will be 0, 1, 2, which is correct. However, the 4th item and that after will always have the index as 2. And I found the returned index is not always stable.
Another question, when I called clearItems() to delete all items, then call addRotatorItem to add some items back from the client side, when I call start() after these operation, the type is AutomaticAdvance, there are strange behavior for the first time animation. It seems start rotating all items, then rotate to the second item the first time. If I clearItems again, and then add items back. The first time start() it will skip 1 pages. Can you tell me what I should do to get a stable rotating animation after I have clearItems and addRotatorItems?
Thanks in advance for suggestions.
Joe
<
telerik:RadComboBox
ID
=
"RadComboBoxDropDown"
runat
=
"server"
OnClientClick
=
"show();"
/>
function show()
{
Alert("Are you sure you want to submit the page?");
}
...
Dim footerItem As GridFooterItem = CType(e.Item, GridFooterItem)
footerItem("NAME").Text = "<
div
>" & var1 & "</
div
>" & String.Format("{0:0.00}", var2)
...