Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
80 views
Hi there

I have some questions to get off my chest that have been bugging us here for a while now, as we have recently learnt that RadControls for ASP.NET has now been cut off, i was wondering if you could answer a few questions for us...

When we see ASP.NET AJAX we are put into the beleif that all the controls contain AJAX (on the fly) and so this will cause our application to fail its accessibility compliance, is this the case or have we just misunderstood the point and that we only fail when we use the Ajax radControl, and the other controls are exactly the same as the ASP.NET controls (with added useful features)

Hope to hear from you soon

Regards

Ahmed
Dimo
Telerik team
 answered on 06 Jul 2009
1 answer
95 views
Hi,

I have a tabstrip and checkboxList and i am updating the checkboxlist when user click on any tab. i am using style on server side. When the page is loaded first time then style applies but when i click on tab then style didn't apply and when i remove the ajax on chekboxList then  style applies on postback but when i apply ajax then it didn't apply. so i think there is an issue with ajax.

My script is this:

<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
  <AjaxSettings>
 <telerik:AjaxSetting AjaxControlID="tabStrip1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="chkBoxList1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManagerProxy>


<telerik:RadTabStrip ID="tabStrip1" runat="server" CausesValidation="False"
                                    DataTextField="col1" DataValueField="col2" OnTabClick="tabStrip1_TabClick"
                                    Skin="Web20">
                                </telerik:RadTabStrip>
                                <asp:CheckBoxList ID="chkBoxList1" runat="server"
                                     DataValueField="col2"  DataTextField="col1"
                                    RepeatDirection="Horizontal">
                                </asp:CheckBoxList>


Server side code that bind the checkboxlist from the database.

chkBoxList1.DataSource = GetDatatable()
chkBoxList1.DataBind();

            foreach (System.Web.UI.WebControls.ListItem item in chkBoxList1.Items)
            {
                if (item.Text == "abc")
                {
                    item.Attributes.Add("Style", "padding-left:22px");
                }
                else if (item.Text == "abc11")
                {
                    item.Attributes.Add("Style", "padding-left:32px");
                }
                else if (item.Text == "def")
                {
                    item.Attributes.Add("Style", "padding-left:43px");
                }
                else if (item.Text == "1213")
                {
                    item.Attributes.Add("Style", "padding-left:52px");
                }
                
                item.Text = "";
            }
        }

Please tell me that how i can resolve this issue.

Thanks.
Yavor
Telerik team
 answered on 06 Jul 2009
1 answer
98 views
Hi all,

I am just about to re-write our web portal (200+ aspx pages) from the ground up, the technologies I am going to use are VS 2010, SQL 2008, ASP.NET AJAX (latest version might consider the beta!), IIS7. I am going to use master pages, user controls within the pages, a lot of the pages are going to have tabstrips, grids, treeviews, panels, and I want to use AJAX for the best performance. My first question is what do you think is the best way to use AJAX, e.g. Manager on the master page and proxies on the content pages, or just a manager on the content, I have nothing on the master page that needs AJAXing, that is all on the content pages. The next question is the use of user controls within an AJAX environment, again is it better to lots of user controls each attempting to do their own bit of AJAX with their own AJAX manager or again just use the proxies. Is it better (from a performance perspective) to not use user controls and attempt to get everything written directly into the content pages rather than lots of user controls.

A typical layout is going to be

Master page,
    Content page,
        Tabstrip,
            Usercontrol
            Usercontrol
            Usercontrol

or

Master page,
    Content page,
        Treeview,
            Usercontrol
            Usercontrol


any advice is welcomed.

Thanks


Alex

Dimo
Telerik team
 answered on 06 Jul 2009
1 answer
219 views

Hi,
I'm porting our software to RadGrid component and I have following problem:

I'm bounding dataset to the Grid in function, which is called in asynchronous way. First call of .Rebind() or .DataBind() is successful. But after binding I'm changing some properties of the grid - e.g. width of grid columns, header text of grid columns etc. Then I'm trying to call .DataBind() (or .Rebind()) again - and this second call fail with error RegisterRequiresControlState can only be called before and during PreRender.

If I will not make the 2nd DataBind() call, then I will not see the visual changes, which I've done in async. task. Is it possible to somehow reshow the grid in async task?

I'm adding class code:

    public partial class _Default : System.Web.UI.Page  
    {  
        public delegate void AsyncMethodCaller();  
 
        private DataSet Data  
        {  
            get  
            {  
                return (DataSet)Session["Data"];  
            }  
        }  
 
        private void SetData()  
        {  
            OracleConnection conn = new OracleConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);  
 
            DataSet set = new DataSet();  
 
            OracleDataAdapter adapter = new OracleDataAdapter("select USER_ID, USER_NAME, FULL_NAME from USERS order by USER_ID", conn);  
            conn.Open();  
            adapter.Fill(set);  
            conn.Close();  
            conn.Dispose();  
 
            Session["Data"] = set;  
 
            BoundData();  
            RadGrid1.DataBind();  
 
            foreach (GridColumn col in RadGrid1.MasterTableView.AutoGeneratedColumns)  
            {  
                //some code  
                col.HeaderText = "*" + col.HeaderText;  
            }  
 
            BoundData();  
            RadGrid1.DataBind();  
        }  
 
        protected void Page_Load(object sender, EventArgs e)  
        {  
            if (!IsPostBack)  
            {  
                PageAsyncTask task = new PageAsyncTask(new BeginEventHandler(BeginGetAsyncData), new EndEventHandler(EndGetAsyncData), new EndEventHandler(TimeoutGetAsyncData), null);  
                RegisterAsyncTask(task);  
            }  
        }  
 
        protected IAsyncResult BeginGetAsyncData(Object src, EventArgs args, AsyncCallback cb, Object state)  
        {  
            AsyncMethodCaller caller = new AsyncMethodCaller(SetData);  
            return caller.BeginInvoke(cb, caller);  
        }  
 
        protected void EndGetAsyncData(IAsyncResult ar)  
        {  
            AsyncMethodCaller caller = (AsyncMethodCaller)ar.AsyncState;  
            caller.EndInvoke(ar);  
        }  
 
        protected void TimeoutGetAsyncData(IAsyncResult ar)  
        {  
            Response.Write("TimeOut!");  
        }  
 
        protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)  
        {  
            BoundData();  
        }  
 
        private void BoundData()  
        {  
            if (Data != null)  
            {  
                RadGrid1.DataSource = Data;  
                RadGrid1.DataMember = ((DataSet)RadGrid1.DataSource).Tables[0].TableName;  
            }  
        }  
 
        protected void btnExportExcel_Click(object sender, EventArgs e)  
        {  
            RadGrid1.MasterTableView.ExportToExcel();  
        }  
    }  
 

The grid is set to have AutoGenerated columns.

Please help,
  Ozon.
Shinu
Top achievements
Rank 2
 answered on 06 Jul 2009
3 answers
104 views
Hi all, i need help for this problem:
I have a grid equal to the example

http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandinput/defaultcs.aspx?product=grid

Il work fine, but It's possible update the value of the cell on the database then user modified the value without pressing the botton SAVE?

The sample: Excel Like Grid is great, but save all line only tab on last field, i need save the row instantly when any field is changed..

Thanks to all

Aurelio




Yavor
Telerik team
 answered on 06 Jul 2009
3 answers
1.4K+ views
Hi,

I posted this query back in April and then May, and received the following replies:

http://www.telerik.com/community/forums/aspnet/general-discussions/how-to-force-a-gridnumericcolumn-on-a-radgrid-to-accept-integer-values-only.aspx


However, these replies still haven't solved the problem.

I have a grid with 3 columns:
Column 1 - a read only GridBoundColumn which displays a string
Column 2 - an editable GridNumericColumn which displays and accepts an integer value only
Column 3 - an editable GridNumericColumn which displays and accepts an double value only

The editable GridNumericColumn (Columns 2 & 3) will always be in edit mode.
The user can then any value on the editable columns.
However, I am still not able to make Column 2 to accept an integer value only (validation done on the client side) .
Column 3 will only accept a double value only.
When the user clicks the submit button on the page, each value of the editable column will be retrieved and stored on the business object.

Can anybody please help me on how to do this (i.e. to make an editable GridNumericColumn on a grid to accept an integer value)?

You can see the web page on http://www.gouw.ws/radgrid

The code is given below:
ASPX
=====
    <form id="form1" runat="server">
    <div>
        <telerik:RadScriptManager ID="radScriptManager" runat="server" />
        <telerik:RadGrid ID="radGrid" AutoGenerateColumns="false" AllowMultiRowEdit="true" AllowMultiRowSelection="true" GridLines="Vertical" OnItemCreated="radGrid_ItemCreated" OnPreRender="radGrid_PreRender" OnNeedDataSource="radGrid_NeedDataSource" runat="server">
            <ClientSettings>
                <Scrolling UseStaticHeaders="true" />
            </ClientSettings>
            <MasterTableView DataKeyNames="Read" EditMode="InPlace" TableLayout="Fixed">
                <Columns>
                    <telerik:GridBoundColumn DataField="Read" DataType="System.String" HeaderText="Read Only" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right" ReadOnly="true" UniqueName="Read" />
                    <telerik:GridNumericColumn DataField="Integer" DataFormatString="{0:N0}" DataType="System.Int32" HeaderText="Integer Only" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right" ReadOnly="false" UniqueName="Integer" />
                    <telerik:GridNumericColumn DataField="Dbl" DataFormatString="{0:#,##0.#0}" DataType="System.Double" HeaderText="Double Only" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right" ReadOnly="false" UniqueName="Dbl" />
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>
    </div>
    <div align="left">
        <asp:Button ID="button" OnClick="button_Click" Text="Submit" runat="server" />
    </div>
    </form>

ASPX.CS
=======
    public partial class Default : System.Web.UI.Page
    {
        private ArrayList _data = new ArrayList();

        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack)
            {
                this._data = (ArrayList)Session["DATA"];
            }
            else
            {
                this._data = Data.Load();
                Session["DATA"] = this._data;
            }
        }

        protected void radGrid_ItemCreated(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridDataItem && e.Item.IsInEditMode)
            {
                RadNumericTextBox numBox = (e.Item as GridDataItem)["Integer"].Controls[0] as RadNumericTextBox;
                numBox.NumberFormat.DecimalDigits = 0;
                numBox.NumberFormat.AllowRounding = false;
                numBox.NumberFormat.KeepNotRoundedValue = true;
            }
        }

        protected void radGrid_PreRender(object sender, System.EventArgs e)
        {
            foreach (GridDataItem item in this.radGrid.Items)
            {
                item.Edit = true;
            }
            this.radGrid.Rebind();
        }

        protected void radGrid_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
            this.radGrid.DataSource = this._data;
        }

        protected void button_Click(object sender, EventArgs e)
        {
            // To fetch the editable value on the grid and to store it into the business object
        }
    }

Thanks & regards,
Herman Gouw
Skype: hermangouw
Princy
Top achievements
Rank 2
 answered on 06 Jul 2009
1 answer
172 views

Dear,

 

While I am getting the information from server database and put the data in the radgrid of a page in web browser, I got the error message

see the image.

 A runtime error has occured. Do you wish to debug? line:15

Error: Sys.WebForms.PageRequestMAnagerParseErrorException;

The message received from the server could not be parsed, Common causes for this error are when response is modified by calls to Response.Write(), response filters, HttpModules, or Server trace is enabled.

Details: Error parsing near 'Telerik.Web.UI.2008'.

 

 

What is the reason and I want solution for it as early as possible?

 

Kind Regards,

Surya.

 

 

 

Kind Regards,

Surya.

Princy
Top achievements
Rank 2
 answered on 06 Jul 2009
1 answer
124 views
Hi,

I want to do custom sorting for which I declared my RadGrid in aspx page  as given below:

<telerik:RadGrid AutoGenerateColumns="False" ID="RadGrid1" DataSourceID="SqlDS" AllowFilteringByColumn="true"
            AllowPaging="True" AllowSorting="True" runat="server" Skin="Office2007" OnPageIndexChanged="RadGrid1_PageIndexChanged"
            OnPageSizeChanged="RadGrid1_PageSizeChanged" OnSortCommand="RadGrid_SortCommand">
            <PagerStyle Mode="NextPrevNumericAndAdvanced" />
            <MasterTableView AllowCustomPaging="true" AllowCustomSorting="true">
                <PagerStyle Mode="NextPrevNumericAndAdvanced" />
                <Columns>
                    <telerik:GridBoundColumn SortExpression="RollNo" HeaderButtonType="TextButton"
                        ShowSortIcon="true">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn SortExpression="StudentName" HeaderButtonType="TextButton" ShowSortIcon="true">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn SortExpression="Address" HeaderButtonType="TextButton" ShowSortIcon="true">
                    </telerik:GridBoundColumn>
                </Columns>
            </MasterTableView>
    </telerik:RadGrid>
<asp:SqlDataSource ID="SqlDS" runat="server" ConnectionString="<%$connectionStrings:cemiConnectionString1%>">
</asp:SqlDataSource>

I want to generate GridBoundColumn's at runtime only as I know which columns I need to show at runtime only. so, I removed the three grid bound columns(RollNo,StudentName and Addresss) from design page. When I remove these columns and adding at runtime, postback is not calling onSortCommand event handler(RadGrid_SortCommand). If I add only RollNo gridboundcolumn then postback is calling my sort event handler for only RollNo column, for others(StudentName,Address) it not calling.

Could you please let me know what is the issue???


Thanks,
Mahesh
Shinu
Top achievements
Rank 2
 answered on 06 Jul 2009
1 answer
82 views
Hi All,
    Im using Grid. In Grid when i click add and save button(In Edit Form) immediately the following javascript error thrown.
i dont know how to get out of this bug.

Error:

Microsoft JScript runtime error: Sys.InvalidOperationException: ScriptLoader.loadScripts cannot be called while the ScriptLoader is already loading scripts.



So, Guide me to get out of this bug.......


-Leo        
Shinu
Top achievements
Rank 2
 answered on 06 Jul 2009
3 answers
134 views
Hi
i would like to know why i cant make telerik items visiable once i have declared them visable = false in page load and i would also like to know why i cant rebind to a grid when i have told the grid server side to rebind

Many thanks in advance
Veli
Telerik team
 answered on 06 Jul 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?