Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
634 views
I am trying to convert a standard asp.net GridView to a RadGrid.

My set up is Windows XP Pro SP3, ASP.NET AJAX controls 2009 Q1 and Visual Studio 2008 3.5 Framework.

In the GridView I have code that will allow me to edit/update/cancel a record.

Please see below the asp.net code with standard GridView
protected void Page_Load(object sender, EventArgs e) 
    { 
        //Load the categories grid only the first tim the page is loaded 
        if (!IsPostBack) 
        { 
            //Load the categories grid 
            BindGrid(); 
 
        } 
    } 
 
    //Populate the GrdView with data 
    private void BindGrid() 
    { 
        //Get category from query string 
        string categoryId = Request.QueryString["CategoryID"]; 
 
        //Get a DataTable object containing the categories 
        grid.DataSource = CatalogAccess.CatalogGetCategories(); 
 
        //Bind the data to the grid 
        grid.DataBind(); 
    } 
 
    //Enter row into edit mode 
    protected void grid_RowEditing(object sender, GridViewEditEventArgs e) 
    { 
        //set the row for which to enale edit mode 
        grid.EditIndex = e.NewEditIndex; 
 
        //set status message 
        statusLabel.Text = "Editing row " + e.NewEditIndex.ToString(); 
 
        //Reload the grid 
        BindGrid(); 
    } 


protected void grid_RowUpdating(object sender, GridViewUpdateEventArgs e) 
    { 
        //retrieve the updated data 
        string id = grid.DataKeys[e.RowIndex].Value.ToString(); 
        string name = ((TextBox)grid.Rows[e.RowIndex].Cells[0].Controls[0]).Text; 
        string description = ((TextBox)grid.Rows[e.RowIndex].FindControl("descriptionTextBox")).Text; 
 
        //execute the update command 
        bool success = CatalogAccess.UpdateCategory(id, name, description); 
 
        //cancel edit mode 
        grid.EditIndex = -1; 
 
        //display status message 
        statusLabel.Text = success ? "Update successful" : "Update failed"
 
        //reload the grid 
        BindGrid(); 
 
    } 
 


Is there a way to achieve the same thing with the RadGrid?  I would appreciate it if anyone could point me in the right direction.

Many thanks

Simon
Simon
Top achievements
Rank 1
 answered on 04 Dec 2009
5 answers
170 views
I have MANY controls on a page that can UPDATE one control, but it will only do one!

This is a sample code:

 

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default" />

 

 

 

 

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1" >

 

 

 

    <AjaxSettings>

 

 

 

        <telerik:AjaxSetting AjaxControlID="btnBack">

 

 

 

            <UpdatedControls>

 

 

 

                <telerik:AjaxUpdatedControl ControlID="tp"/>

 

 

 

            </UpdatedControls>

 

 

 

        </telerik:AjaxSetting>

 

 

 

    <telerik:AjaxSetting AjaxControlID="btnForward">

 

 

 

            <UpdatedControls>

 

 

 

                <telerik:AjaxUpdatedControl ControlID="tp"/>

 

 

 

            </UpdatedControls>

 

 

 

    </telerik:AjaxSetting>

 

 

 

    </AjaxSettings>

 

 

 

 

</telerik:RadAjaxManager>

Why is it that only the top control works but the Manager ignores the other?

Thanks

 

 

O'Man
Top achievements
Rank 1
 answered on 04 Dec 2009
2 answers
107 views
After a postback, I expand the splitter to show the top pane and it's blank.  I inspected the markup and see that the width and height of the top pane are 0px.  This only seems to happen after a postback has occurred.  Has anyone else encountered this?
Jason Reis
Top achievements
Rank 1
 answered on 04 Dec 2009
2 answers
649 views
not sure if I'm missing something obvious here - but is there a way to right align a single menu item?
Basically I have a 100% width menu - where I want most of the menu items to appear normally (aligned to the left) but the last item (a logoff button) to always appear at the right side (end) of the menu.

Possible?
barshj
Top achievements
Rank 1
 answered on 04 Dec 2009
3 answers
130 views
I have a simple page with a listbox and two buttons. I use a RadAjaxManager and an RadAjaxPanel. I have tried setting the manager to handle the panel requests and I have tried using to the panel itself to handle the ajax requests.  Neither method will raise the OnRequestStart event when I click a button and handle the buttons click event.

I have this working in plenty of other places.  I cant seem to determine why in this case it is not working. Functionally, they are identical.

any ideas?  Is there any absolute method to try which will always cause the event to fire?



Pavlina
Telerik team
 answered on 04 Dec 2009
10 answers
394 views
We are implementing a Month/Year picker (http://www.telerik.com/community/code-library/aspnet-ajax/calendar/month-year-picker.aspx#944510) in the FilterTemplate of a RadGrid. I have copied the code from the grid below.  I have not been able to get the javascript to get a reference to the pickers ClientID - the compiler complains it does not know the TechManListPicker control.

Thanks

<telerik:GridDateTimeColumn HeaderText="Technical Manual Date" ReadOnly="true" DataField="TechnicalManualDate" DataFormatString="{0:MM/yyyy}">
                    <FilterTemplate>
                        <telerik:RadDatePicker ID="TechManListDatePicker" runat="server">
                            <DateInput DateFormat="MM/yyyy">
                            </DateInput>
                            <Calendar>
                                <FastNavigationSettings TodayButtonCaption="current date" />
                            </Calendar>
                        </telerik:RadDatePicker>
                        <telerik:RadScriptBlock ID="radScriptBlock" runat="server" >
                            <script type="text/javascript">
                                //override the onload event handler to change the picker after the page is loaded
                                //Sys.Application.add_load(setCalendarTable);

                                function setCalendarTable() {

                                    var picker = $find("<%= TechManListDatePicker.ClientID %>");
                                    var calendar = picker.get_calendar();
                                    var fastNavigation = calendar._getFastNavigation();

                                    $clearHandlers(picker.get_popupButton());
                                    picker.get_popupButton().href = "javascript:void(0);";
                                    $addHandler(picker.get_popupButton(), "click", function() {
                                        var textbox = picker.get_textBox();
                                        //adjust where to show the popup table
                                        var x, y;
                                        var adjustElement = textbox;
                                        if (textbox.style.display == "none")
                                            adjustElement = picker.get_popupImage();

                                        var pos = picker.getElementPosition(adjustElement);
                                        x = pos.x;
                                        y = pos.y + adjustElement.offsetHeight;

                                        var e = {
                                            clientX: x,
                                            clientY: y - document.documentElement.scrollTop
                                        };
                                        //synchronize the input date if set with the picker one
                                        var date = picker.get_selectedDate();
                                        if (date) {
                                            calendar.get_focusedDate()[0] = date.getFullYear();
                                            calendar.get_focusedDate()[1] = date.getMonth() + 1;
                                        }

                                        $get(calendar._titleID).onclick(e);

                                        return false;
                                    });

                                    fastNavigation.OnOK =
                                        function() {
                                            var date = new Date(fastNavigation.Year, fastNavigation.Month, 1);
                                            picker.get_dateInput().set_selectedDate(date);
                                            fastNavigation.Popup.Hide();
                                        }


                                    fastNavigation.OnToday =
                                        function() {
                                            var date = new Date();
                                            picker.get_dateInput().set_selectedDate(date);
                                            fastNavigation.Popup.Hide();
                                        }
                                }   
                            </script>
                        </telerik:RadScriptBlock>
                    </FilterTemplate>
                </telerik:GridDateTimeColumn>
Pavlina
Telerik team
 answered on 04 Dec 2009
1 answer
107 views
 I upgraded the RadControls for ASP.NET to Q1 2009.  Everything worked fine.  I download RadControls for ASP.NET AJAX version 2009.3 1103 release.  I tried replacing a grid with the ajax grid and it tells me of course I needed a script manager.  So i added the RadScripManager.  When I try to load the page I get the following error. 

Unable to cast object of type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection' to type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection'.

I'm sure I have a lot of fluff in the web config file and bin folder, but I really don't know what to change.

Thanks for any help.
Veselin Vasilev
Telerik team
 answered on 04 Dec 2009
2 answers
69 views
I am using RadScheduler for the first time.

I am trying to understand if its possible to use the scheduler depending on their privileges.
(Well in my case) Could a user only view the scheduler, an admin update / edit / delete / add an appointment (have all the privileges) ?
What would be the best approach to this?

And also any information or a sample on using different tables to fetch data into the scheduler, would be greatly appreciated. I am trying to pull up data into a scheduler depending on different users. And each type of user will be identified by their location and there are admins in that particular location who could modify the events in the scheduler. There are also general admins who could have access to all the locations. So its three different scenarios.

Thanks for your inputs in advance.

Sant.
Sant Ra
Top achievements
Rank 1
 answered on 04 Dec 2009
3 answers
564 views
Hi,

I am using Visual Studio 2008, Rad Conrtols for ASP.NET AJAX Q2 2009 and .net Framework 3.5 and C# Programming.
I am using RAD Grid to display the data and in line mode to edit the data.
i want to always have an emptyrow in the grid so that when the user doule clicks on this empty row, the grid goes into edit mode, user clicks on save and the new row is added.
If there are any rows in the grid already, user can edit the rows by double clicking in a cell and when double click on the empty row user can type in new data.
Thus when clicked on save button, the data in the empty row is added and the data in the other rows is updated.

Thanks,
RKS
Roland
Top achievements
Rank 1
 answered on 04 Dec 2009
1 answer
83 views
What is the best method to use when exporting the schedulers appointments when populating the data via a
WCF service?  

When trying to use the Export post-back ExportToICalendar method the radscheduler does not have the appointments collection populated.

Peter
Telerik team
 answered on 04 Dec 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
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
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?