<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest" >
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadMultiPagetab" /> -- (if i mentioned this one i am getting error)
<telerik:AjaxUpdatedControl ControlID="RadTabStrip2" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
<div style="float: left; width: 100%; min-height: 830px;">
<div style="float: left; width: 100%; background-image: url(../images/bridge_logo_bg.jpg);
background-repeat: repeat-x;">
<telerik:RadTabStrip ID="RadTabStrip2" runat="server" MultiPageID="RadMultiPagetab"
SelectedIndex="0" Orientation="HorizontalTop" ShowBaseLine="true" CssClass="tabStrip">
<Tabs>
<telerik:RadTab Text="Overview" ToolTip="Overview">
</telerik:RadTab>
<telerik:RadTab Text="Attendance" ToolTip="Attendance">
</telerik:RadTab>
<telerik:RadTab Text="Discipline" ToolTip="Discipline">
</telerik:RadTab>
</Tabs>
</telerik:RadTabStrip>
</div>
<telerik:RadMultiPage ID="RadMultiPagetab" runat="server" SelectedIndex="0" >
<!-- Overview -->
<telerik:RadPageView ID="RadPageView2" runat="server">
<telerik:RadHtmlChart runat="server" ID="radhtml_dt" Width="240px" Height="300px"
OnClientSeriesClicked="OnClientSeriesClicked">
<Appearance>
<FillStyle />
</Appearance>
<Legend>
<Appearance Visible="false" />
</Legend>
<PlotArea>
<YAxis>
</YAxis>
</PlotArea>
<Legend>
<Appearance Position="Right" />
</Legend>
<ChartTitle Text="Disc : Top 10">
</ChartTitle>
</telerik:RadHtmlChart>
</div>
</telerik:RadPageView>
<telerik:RadPageView ID="Disc" runat="server">
..... some controls---------------
</telerik:RadPageView>
<telerik:RadPageView ID="Enroll" runat="server">
----some controls---------------
</telerik:RadPageView>
</telerik:RadMultiPage>
<telerik:RadCodeBlock ID="codeBlock" runat="server">
<script type="text/javascript">
function OnClientSeriesClicked(sender, args) {
// debugger;
$find("<%= RadAjaxManager1.ClientID %>").ajaxRequest(args.get_category() + ";" + sender._uniqueId);
var totstring = args._seriesData.toString();
var count = (totstring.split(",").length)
for (var i = 0; i < count; i++) {
if (args._seriesData[i].value != args.get_value()) {
args._seriesData[i].explode = false;
}
else {
args._seriesData[i].explode = true;
}
}
sender.repaint();
}
</script>
</telerik:RadCodeBlock>

<telerik:RadAjaxManager runat="server" ID="RadAjaxManager1" > <AjaxSettings> <telerik:AjaxSetting AjaxControlID="RadGridResults"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="RadGridResults" /> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="RadGridResultsTest"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="RadGridResultsTest" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings></telerik:RadAjaxManager>if (e.IsFromDetailTable || e.RebindReason == GridRebindReason.InitialLoad) return; RadGridResultsTest.DataSource = GetMainData();e.RebindReason == GridRebindReason.InitialLoadpublic void CustomizedGridPagerSize(GridItemEventArgs e) { int allItemsCount = (e.Item as GridPagerItem).Paging.DataSourceCount; RadComboBox combo = (e.Item as GridPagerItem).FindControl("PageSizeComboBox") as RadComboBox; RadComboBoxItem item1 = new RadComboBoxItem("10", "10"); RadComboBoxItem item2 = new RadComboBoxItem("20", "20"); RadComboBoxItem item3 = new RadComboBoxItem("50", "50"); RadComboBoxItem item4 = new RadComboBoxItem("100", "100"); RadComboBoxItem item5 = new RadComboBoxItem("200", "200"); RadComboBoxItem item6 = new RadComboBoxItem("All", allItemsCount.ToString()); item1.Attributes.Add("ownerTableViewId", e.Item.OwnerTableView.ClientID); item2.Attributes.Add("ownerTableViewId", e.Item.OwnerTableView.ClientID); item3.Attributes.Add("ownerTableViewId", e.Item.OwnerTableView.ClientID); item4.Attributes.Add("ownerTableViewId", e.Item.OwnerTableView.ClientID); item5.Attributes.Add("ownerTableViewId", e.Item.OwnerTableView.ClientID); item6.Attributes.Add("ownerTableViewId", e.Item.OwnerTableView.ClientID); combo.Items.Clear(); combo.Items.Add(item1); combo.Items.Add(item2); combo.Items.Add(item3); combo.Items.Add(item4); combo.Items.Add(item5); combo.Items.Add(item6); combo.Items.FindItemByValue(((RadGrid)e.Item.OwnerTableView.Parent).PageSize.ToString()).Selected = true; }
if we use the default paging sizes then it is working well and we can load the grid settings,
but when we use the code above to increase the paging sizes then when we load the grid settings we found the pager not saved
Regards
AhmedSalem
| <telerik:RadTextBox ID="RadTextBox1" Runat="server" |
| EmptyMessage="Enter you desired username" |
| Label="User Name" |
| Required="True" |
| RequiredMessage="Username is mandatory" |
| ShowRedStar="True" |
| MinLength="5" |
| MinLengthMessage="Your username is too short" |
| MaxLength="20" |
| MaxLengthMessage="Use shorter username" |
| Regex="[a-zA-Z0-9]" |
| RegexMessage="Please use only alphabet and numbers" |
| > |
| </telerik:RadTextBox> |
How can I add a custom data attribute to a combo box that is dynamically created and bound to a DataTable?
protected RadComboBox AddProductsCombo(int catID, int prodID) { RadComboBox RadComboBox1 = new RadComboBox(); RadComboBox1.ID = "RadComboBox1"; RadComboBox1.AutoPostBack = true; RadComboBox1.SelectedIndexChanged += new RadComboBoxSelectedIndexChangedEventHandler(RadComboBox1_SelectedIndexChanged); PlaceHolder1.Controls.Add(RadComboBox1); MySqlConnection conn = new MySqlConnection(ConfigurationManager.ConnectionStrings["MySQLConn"].ConnectionString); conn.Open(); string sqlSelect1 = "SELECT p.prodID AS Id, p.prodName As Name, tsp.siteproductTypeID As Attr, p.catID FROM products AS p INNER JOIN tblsiteproducts AS tsp ON tsp.prodID = p.prodID WHERE tsp.isActive = 1 AND tsp.siteID = 1 AND p.catID = ?catID AND isAddon = 0 ORDER BY prodSort ASC"; MySqlDataAdapter adapter1 = new MySqlDataAdapter(); MySqlCommand cmd1 = new MySqlCommand(sqlSelect1, conn); adapter1.SelectCommand = cmd1; cmd1.Parameters.Add("?catID", MySqlDbType.Int32).Value = catID; DataTable dt1 = new DataTable(); adapter1.Fill(dt1); RadComboBox1.DataTextField = "Name"; RadComboBox1.DataValueField = "Id"; RadComboBox1.DataSource = dt1; RadComboBox1.DataBind(); RadComboBox1.SelectedValue = prodID.ToString(); return RadComboBox1; }