Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
48 views
on the index change of rad combobox arad grid must appear with dynamically created columns containing rad comboboxes and those comboboxes are to be binded with some data from database.the columns with comboboxes are coming but i am unable to bind with data. i am doing this programmatically using ITEMPLATE interface by inheriting in a class and calling InstantiateIn method.
help by sending or posting a code snippet.
thanks in advance
Anirud
    //calling this function inside an event
    public void loadGrid()
    {
      //looping for creating 31 columns
            for (int I_ColumnCount = 1; I_ColumnCount <= 31; I_ColumnCount++)
            {
                 
                GridTemplateColumn gridtemplatecolumn = new GridTemplateColumn();
                gridtemplatecolumn.ItemTemplate = new MyTemplate(Convert.ToString(I_ColumnCount));
                gridtemplatecolumn.HeaderText = Convert.ToString(I_ColumnCount);
                this.rg_Attendence.MasterTableView.Columns.Add(gridtemplatecolumn);
                ViewState["grid_DayCount"]=Convert.ToString(I_ColumnCount);
            }
    }
    
    public class MyTemplate : ITemplate
    {
        protected RadComboBox lblControl;
        public string colname;
        public MyTemplate(string cName)
        {
            colname = cName;
             
        }
        public void InstantiateIn(System.Web.UI.Control container)
        {
             
            lblControl = new RadComboBox();
            lblControl.ID = colname;
            container.Controls.Add(lblControl);
        }
    }
 
    //this function contains data which is retrieved from database and need to bind to rad grid and comboboxes(which are created inside rad grid dynamically)
    protected void loadEmployees()
    {
            RadComboBox lblControl = new RadComboBox();
            
            DataTable DT_Employee = new DataTable();
            DT_Employee = BLL.get_Attendance(_obj_Smhr_Attendance);
            if (DT_Employee.Rows.Count == 0)
            {
                
                    rg_Attendence.Visible = true;
                    rg_Attendence.DataSource = DT_Employee;
                    rg_Attendence.DataBind();
                    for (i = 0; i <= rg_Attendence.Items.Count - 1; i++)
                    {
                        //here i am trying to bind data to comboboxes which are created dynamically inside rad grid
                        rcmbList = rg_Attendence.Items[i].FindControl("lblControl") as RadComboBox;
                        if (Convert.ToString(Convert.ToString(DT_Employee.Rows[i][3])) == "0")
                            rcmbList.SelectedIndex = rcmbList.FindItemIndexByValue(Convert.ToString("P"));
                        else if (Convert.ToString(Convert.ToString(DT_Employee.Rows[i][3])) == "1")
                            rcmbList.SelectedIndex = rcmbList.FindItemIndexByValue(Convert.ToString("L"));
                        
                    }
                }
                else
                {
                    rg_Attendence.Visible = false;
                    btn_Save.Visible = false;
                    btn_Finalize.Visible = false;
                }
            }
            else
            {
                _obj_Smhr_Attendance.OPERATION = operation.Check;
                _obj_Smhr_Attendance.ATTENDANCE_MODE = true;
                DT_Employee = BLL.get_Attendance(_obj_Smhr_Attendance);
                rg_Attendence.Visible = true;
                rg_Attendence.DataSource = DT_Employee;
                rg_Attendence.DataBind();
                for (i = 0; i <= rg_Attendence.Items.Count - 1; i++)
                {
                    //here i am trying to bind data to comboboxes which are created dynamically inside rad grid 
                    lblControl = rg_Attendence.Items[i].FindControl("colname") as RadComboBox;
                    if ((Convert.ToString(Convert.ToString(DT_Employee.Rows[i][2]))).Trim() == "P")
                    {
                        lblControl.SelectedIndex = lblControl.FindItemIndexByValue(Convert.ToString("P"));
                    }
                    else if ((Convert.ToString(Convert.ToString(DT_Employee.Rows[i][2]))).Trim() == "L")
                    {
                        lblControl.SelectedIndex = lblControl.FindItemIndexByValue(Convert.ToString("L"));
                    }
                    
                     
                }
                
            }
            
    }
}
Iana Tsolova
Telerik team
 answered on 15 Mar 2011
2 answers
95 views
I'm using a radcombox (with custom text). I need to be able to change the caret position in the input area of the combo box from the client side.

I can figure out how to get the input domelement - but for the life of me I can't figure out how to change the caret position.

Help!

Thanks.
Karl
Top achievements
Rank 1
 answered on 15 Mar 2011
0 answers
82 views
Hi All,

I have implemented the self ref hierarchy in my page as per the instruction and it is working fine. but yesterday i found that when there are more than 15 records (15 is page size for grid) on secondary level grid shows pagination footer and after clicking on next page button (secondary level pagination) it updates primary level and navigate to the next page of grid instead of secondary levels next page. :(

Please help me..

This is my code
    <telerik:RadGrid ID="RadGrid1" AllowPaging="true" runat="server" PageSize="15">
        <PagerStyle Mode="NextPrevAndNumeric" />
        <MasterTableView HierarchyDefaultExpanded="true" HierarchyLoadMode="Client" Width="100%"
            DataKeyNames="PRIMARYSERIALNUMBER,SERIALNUMBER">
            <SelfHierarchySettings ParentKeyName="PRIMARYSERIALNUMBER" KeyName="SERIALNUMBER" />
            <Columns>
                <telerik:GridTemplateColumn>
                    <ItemTemplate>
                        <asp:HyperLink ID="hLinkName" runat="server" ToolTip='<%# DataBinder.Eval(Container.DataItem, "NAME") %>'> </asp:HyperLink>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>  
chetan jagtap
Top achievements
Rank 1
 asked on 15 Mar 2011
4 answers
264 views
Given all the known advantages/disadvantages of doing an ASP.NET or a WinForm app, which way would you go if you are building an internal application and don't need the "Hey, I could go to ANY computer and get to the asp.net app!" advantage?  I look at the number of threads in the asp.net forum and then the winform forum and I get the overwhelming sense that most are using asp.net.

It's been about 6 years since I've done any serious coding but I need to get back into the game to modernize myself.  Therefore I may agree to write a fair sized application for a company.  Telerik will enable me to accelerate the development of the app, etc.  Now the choice becomes asp.net or winform?

I gravitate away from from asp.net because that platform just seems to fight you each step of the way.  Things that are simple in winforms are not in asp.net.  Are they truly that way or is because I have not done any significant coding in a while?  It also seems that Telerik is embracing the browser apps more than winforms so that should confirm the continued tried of the industry towards asp.net.

I think I already know the response but if you got YOUR choice would you do the winform or the asp.net?
Stefan
Telerik team
 answered on 15 Mar 2011
2 answers
191 views
hi to all
 i have a radgrid bind on neededdatasource and now i want to rebind it on button click before that i want to clear the radgrid.
How can I do this?
help me......
thanks
Jaroslaw
Top achievements
Rank 1
 answered on 15 Mar 2011
6 answers
323 views
I have two RadListBox controls in a ASP.NET user control with the allowtransfer property set to true. I  populate the RadListBox with RadListBoxItems on page load. The RadListBox is populated, but the text is not visible for any of the items. If I transfer the items to the other RadListBox, they transfer, but they are again not visible. I then refresh the page and I can see them in the second RadListBox. I transfer them back to the first RadListBox and the text is then visible in that listbox also. Please help, I can't seem to find what is causing the text to not display.
Genady Sergeev
Telerik team
 answered on 15 Mar 2011
2 answers
129 views

Hi @

I am using Telerik Rad list boxes in my application The list box's are inside Telerik:RadAjaxPanel. I some time get the following error when the page with RadListbox loads.

This is a show stopper in my application. I am forced to go back to asp:list boxes.

The content page is inside a Nested Master Page and master page contain the Rad tab strip.

Please help me how to get rid of this Issue.

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)
Timestamp: Wed, 9 Mar 2011 09:47:16 UTC

Message: Sys.InvalidOperationException: Component 'ctl00_ctl00_ContentPlaceHolder1_Main_uclFieldSelection_RHSListBox' was not found.
Line: 4599
Char: 25
Code: 0
URI: ScriptResource.axd?d=qlvRxOrmpywM_08z8refchHddcbVZsvK4Ywotss_Ymd_2hJVYkLcDxVnLi_OeSkv8B6tfayteJ6SVeKd7o_DwYe4725KqPpiYzA653aPMP_F0rYUNPf5bufsZONZE3BA1W0wDg2&t=ffffffffcb989f59

I have tried the following options without any success:
1) Made sure that ScriptResource.axd reference is in web.config <httphandlers> and <handlers> section.
2) I have replaced the telerik:radajaxpanel with asp:updatepanel
3) I have removed all the client side events from the list boxes.
4) I have made sure that order of ScriptManager is at the top of any other controls

Please suggest me how to proceed.

Genady Sergeev
Telerik team
 answered on 15 Mar 2011
1 answer
224 views
In RadGrid we have a property "EnableColumnViewState" which can be set as false so that the grid when we add and remove columns across postbacks there is no error like "'ColumnName' is neither a DataColumn nor a DataRelation for table Table."

The same Error I am encountering in RadTreeList but i am unable to find a property like "EnableColumnViewState". Is there any Property like this available in RadTreeList currently. If not can anyone please tell me what else could be causing the issue.

Thanks In Advance.

Tsvetina
Telerik team
 answered on 15 Mar 2011
1 answer
65 views
Hi ,

I am using a RadAjaxLoadingPanel in my web page with RadAjaxManagerProxy .I am updating grid control with RadAjaxManagerProxy  and has included this loading Panel while updating. The problem I am facing is that in my application the loading image   icon but hides behind the grid . Its not displayed over the grid . I don't why this is happening because same code I am using on another page in our application and its working perfectly.


Please help in this, Thanks in advance
Radoslav
Telerik team
 answered on 15 Mar 2011
1 answer
84 views
How can I style or get my ajax treeview contorl to look like the one on the Silverlight Dashboard demo?

Thanks,
KS
Shinu
Top achievements
Rank 2
 answered on 15 Mar 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?