Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
807 views
I am building a DataTable dynamically at run time and I am also using templates in the Cells that again are dynamically loaded.
The template is currently extremely simple in that it consists solely a CheckBos and a HiddenField like so:
<asp:CheckBox ID="cb" runat="server" /> <asp:HiddenField ID="hf" runat="server" />

I trap the ItemDataBound Event of the Grid and have code similar to that below:
if (e.Item is GridDataItem)
{
    GridDataItem item = (GridDataItem)e.Item;
    DataRowView drv = (DataRowView)item.DataItem;
    for (int i = 0; i < rgTags.MasterTableView.Columns.Count; i++ )
    {
        string uniqueName = rgTags.MasterTableView.Columns[i].UniqueName;
        if (drv[i] is System.DBNull)
        {
            item[uniqueName].Controls[0].FindControl("cb").Visible = false;
        }
        else
        {
            AdminTag tag = (AdminTag)drv[i];
            ((CheckBox)item[uniqueName].Controls[0].FindControl("cb")).Text = tag.sText;
            ((HiddenField)item[uniqueName].Controls[0].FindControl("hf")).Value = tag.nTagId.ToString();
        }
    }
}

My question is why do I have to have the Controls[0]. before the FindControl() calls? I don't like hard coding things like that and would prefer a more elegant way to find the control in the template.

It is wo0rking now, but it's inelegant and it took me a long time to figure it out and I am sure it will get broken b y a future release.

Martin
Tsvetina
Telerik team
 answered on 19 Jan 2012
1 answer
55 views
The RadMenu control has the Target Property, How do I set this property when binding the menu to a SiteMapDataSource?
Peter
Telerik team
 answered on 19 Jan 2012
4 answers
435 views
Hi All,

i am using a RadMenu on my page and i am handling its click event from server side...

when i click on of the item i open another page in rad window ...

all is ok and the window is opened successfully.... i do what i need there and close it...

BUT

i noticed when i refresh the page that holds the radmenu, the click event is called again and the RadWindow is opened again!!!

how can i avoid this from happening!!!

Best Regards
Asa'ad
Kate
Telerik team
 answered on 19 Jan 2012
1 answer
82 views
Is there a way to limit client-side row selection to one row per grouping in a radgrid without causing a postback every time?

I used an old example (see below), but each click of a checkbox causes a postback which is disruptive to the process. I wasn't sure if there was some built in functionality or an easy way to check at the end if too many were selected.

Thank you..

<radG:GridTemplateColumn UniqueName="CheckBoxColumn">
 <ItemTemplate>
   <asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="true" OnCheckedChanged="CheckedChanged" />
 </ItemTemplate>
</radG:GridTemplateColumn>

public void CheckedChanged(object sender, EventArgs e)
    {
        GridDataItem checkedItem = (GridDataItem)(sender as CheckBox).NamingContainer;
        string checkedItemIndex = checkedItem.GroupIndex.Substring(checkedItem.GroupIndex.LastIndexOf('_'), 2);
 
        foreach (GridDataItem item in checkedItem.OwnerTableView.Items)
        {
            string currItemIndex = item.GroupIndex.Substring(item.GroupIndex.LastIndexOf('_'), 2);
 
            if (checkedItem.GroupIndex.StartsWith(item.GroupIndex.Substring(0,1)) && currItemIndex != checkedItemIndex)
            {               
                (item.FindControl("CheckBox1") as CheckBox).Checked = false;
            }
        }
    }
Tsvetina
Telerik team
 answered on 19 Jan 2012
2 answers
157 views
Hi,
I am getting the String was not recognized a a valid date time in radscheduler on clicking the date of month view.
I am using Telerik version 2010.1.519.40 dll in IE 8.I have attached screenshots
deepak
Top achievements
Rank 2
 answered on 19 Jan 2012
2 answers
96 views
Can we expect to see the same level of we service binding available for RadListView as we have with, say, RadGrid? -- Stuart
Stuart Hemming
Top achievements
Rank 2
 answered on 19 Jan 2012
1 answer
61 views
Hi,
    
    I am using Rad Scheduler Control. I want the time slots to be displayed as 7:00 am,15,30,45,8:00 am when i set MinutesPerRow to 15. And also I want to highlight the current time's row.
 Please tell how can I achieve this.

Thanks
Lokesh 
               
Peter
Telerik team
 answered on 19 Jan 2012
1 answer
394 views
hello,

 i want bind the listview on textbox change 

i mean when i type any word then listview bind data from my database and refresh on next world on textbox when i type

i am not get any help 
so please tell me some idea or code 

thanks
Princy
Top achievements
Rank 2
 answered on 19 Jan 2012
1 answer
87 views
I am using Telerik Rad Tree List. when expanding the tree , it is postback and get child data from server. it is ok. but when collapse the tree, the page is again reload.

i am not sure, it is default action in telerik tree list.

i am using vs2010 and sql server 2008 for my web application.

How to avoid the reloading while collapse the tree.

Thanks,
Uma
Shinu
Top achievements
Rank 2
 answered on 19 Jan 2012
2 answers
102 views
hi expert,

i am using the telerik rad grid in my projects can you please suggest the proper way for my problem

this is hierarchical grid(3 level) in the second and third level i use the "GridDropDownColumn" columns with my own datasource when i am in editing that row it show  the dorpdown when i change the drop down value in it the other column's values will be changed corresponding with some logic how can it possible and one more this i want to edit the multiple rows all the changes will be saved at final is it possible in this control. my code is  ,please look at the attached image also.

 &nbsp;<telerik:RadGrid ID="dgProduct" runat="server" AutoGenerateColumns="false" AllowAutomaticUpdates="true"
                                        AutoGenerateHierarchy="true" >
                                        <MasterTableView EditMode="InPlace" >
                                            <Columns>
                                                <telerik:GridBoundColumn DataField="PKProductID" HeaderText="PKProductID" Visible="false"><HeaderStyle BackColor="BlanchedAlmond" /></telerik:GridBoundColumn>
                                                <telerik:GridBoundColumn DataField="SourceID" HeaderText="Style #" />
                                                <telerik:GridBoundColumn DataField="Language1Title" HeaderText="Title" />
                                                <telerik:GridBoundColumn DataField="Language1SubTitle" HeaderText="Sub Title" />
                                                <telerik:GridDropDownColumn HeaderText="Clearance" UniqueName="StyleClearance" DataSourceID="SourceCheck"
                                                    ListTextField="Text" ListValueField="Text" SortExpression="Text" DataField="ClearanceItem" />
                                                <telerik:GridDropDownColumn HeaderText="Active" UniqueName="StyleActive" DataSourceID="SourceCheck"
                                                    ListTextField="Text" ListValueField="Text" SortExpression="Text" DataField="Active" />
                                                <telerik:GridBoundColumn DataField="Price" HeaderText="Price" />
                                                <telerik:GridBoundColumn DataField="SalePrice" HeaderText="Sale Price" />
                                            </Columns>
                                            <DetailTables>
                                                <telerik:GridTableView DataMember="Colors" HierarchyLoadMode="ServerOnDemand" >
                                                    <Columns>
                                                        <telerik:GridBoundColumn DataField="FKProductid" HeaderText="FKProductid" Visible="false" />
                                                        <telerik:GridBoundColumn DataField="Language1Title" HeaderText="Title" ReadOnly="true" />
                                                         <telerik:GridBoundColumn DataField="PKGroupScaleItemID" HeaderText="Color Id" ReadOnly="true"  />
                                                           <telerik:GridDropDownColumn UniqueName="ColorSourceID" DataSourceID="SourceColors"
                                                            HeaderText="Colors" DataField="SourceID" SortExpression="ScaleLanguage1Name"
                                                            ListTextField="ScaleLanguage1Name" ListValueField="ScaleType" />
                                                        <telerik:GridDropDownColumn HeaderText="Active" UniqueName="ColorActive" DataSourceID="SourceCheck"
                                                            ListTextField="Text" ListValueField="Text" SortExpression="Text" DataField="Active" />
                                                    </Columns>
                                                    <DetailTables>
                                                        <telerik:GridTableView DataMember="Sizes" HierarchyLoadMode="ServerOnDemand"  Width="300px" >
                                                            <Columns>
                                                                <telerik:GridBoundColumn DataField="FKProductid" HeaderText="FKProductid" Visible="false" />
                                                                <telerik:GridBoundColumn DataField="Language1Title" HeaderText="Title" ReadOnly="true"  />
                                                                <telerik:GridBoundColumn DataField="SourceID" HeaderText="Size ID" ReadOnly="true" />
                                                                <telerik:GridDropDownColumn UniqueName="SizeSourceID" DataSourceID="SourceSizes"
                                                                    HeaderText="Sizes" DataField="SourceID" SortExpression="ScaleLanguage1Name" ListTextField="ScaleLanguage1Name"
                                                                    ListValueField="PKGroupScaleItemID" />
                                                                <telerik:GridBoundColumn DataField="BackOrderDays" HeaderText="Back Order Days" />
                                                                <telerik:GridBoundColumn DataField="SKU" HeaderText="SKU" />
                                                                <telerik:GridBoundColumn DataField="QuantityAvailable" HeaderText="Quantity" />
                                                                <telerik:GridDropDownColumn HeaderText="Active" UniqueName="SizeActive" DataSourceID="SourceCheck"
                                                                    ListTextField="Text" ListValueField="Text" SortExpression="Text" DataField="Active" />
                                                            </Columns>
                                                        </telerik:GridTableView>
                                                    </DetailTables>
                                                </telerik:GridTableView>
                                            </DetailTables>
                                            <EditFormSettings>
                                                <EditColumn Reorderable="false" Resizable="false" />
                                            </EditFormSettings>
                                        </MasterTableView>
                                        <ClientSettings>
                                            <ClientEvents OnRowClick="RowClick" OnRowDblClick="RowDblClick" />
                                            <ClientEvents OnColumnMouseOut=" />
                                        </ClientSettings>
                                    </telerik:RadGrid>
koteswararao
Top achievements
Rank 1
 answered on 19 Jan 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?