Telerik Forums
UI for ASP.NET AJAX Forum
7 answers
181 views
Hi Guys

I have a radgrid bind with object datasource.
I want to implement sorting on grid columns.but in rad grid automatic sorting is implemented only when the grid is bind with datatables or dataview.

Please provide me a sample which have a grid sort on client side and bind with object datasource.

Its very urgent.

Thanks in advance.
Veli
Telerik team
 answered on 05 Mar 2010
3 answers
113 views
I cannot select GridClienteSelectColumn from code.

I do it in ItemDataBind function.

 protected void dgCategorie_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
    {
        if (e.Item.ItemType != GridItemType.Item && e.Item.ItemType != GridItemType.AlternatingItem)
            return;

        GridDataItem item = (GridDataItem)e.Item; 

        switch (e.Item.OwnerTableView.Name)
        {
            case "categorie":

                 
                var chkAutoriz = (CheckBox)item["ClientSelectColumn"].Controls[0];
                chkAutoriz.Checked = (item["AutorizTuttoCat"].Text == "True") ? true : false;
                break;

            case "analisi" :

                var chkAutorizSottoCat = (CheckBox)item["ClientSelectColumnSotto"].Controls[0];
                chkAutorizSottoCat.Checked = (item["Autoriz"].Text == "True") ? true : false;
                break;
        }

      
    }
Thanks.
Tsvetoslav
Telerik team
 answered on 05 Mar 2010
4 answers
253 views
Hi,

I am working with Rad gird Client-side Insert/Update/Delete. I'm referring the demo code.

I'm getting a null vlaue error for args.get_gridDataItem() when i select a row

 

Here is your code

 

function

 

rowSelected(sender, args)

 

{

 

//controlID = args.getDataKeyValue("ControlID");
Id = getDataItemKeyValue(sender,args.get_gridDataItem());

 

currentRowIndex = args.get_gridDataItem().get_element().rowIndex;

 

$find(

"<%= RadTabStrip1.ClientID %>").set_selectedIndex(0);

 

 

GetControlByControlID(controlID, setValues)

 

}

Whts the problem??

Tsvetoslav
Telerik team
 answered on 05 Mar 2010
1 answer
519 views
Hi,

I generally use Asp.Net Gridview. In these grid i use to add multiple Header rows on Runtime by using "OnRowCreated" Event of the grid.

-----ASP.Net HTML code
 <asp:GridView ID="gv" runat="server" AllowSorting="False" AutoGenerateColumns="False"
                                        Width="350px" UseAccessibleHeader="False"
                                        OnRowDataBound="gv_RowDataBound" OnRowCreated="gv_RowCreated">

---------In Event

protected void gv_RowCreated(object sender, GridViewRowEventArgs e)
    {
            if (e.Row.RowType == DataControlRowType.Header)
            {
                //Header row 1

                GridViewRow headerRow = new GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Normal);

                headerRow.Cells.Add(CreateHeaderCell("Col1", "TestCol1", 1, 2,50)); 
                headerRow.Cells.Add(CreateHeaderCell("Col2", "TestCol2", 1, 1,50)); 

                ((GridView)sender).Controls[0].Controls.AddAt(0, headerRow);
               
                //e.Row.Visible = false; //for hiding Normal header row if needed
            }
    }
-------------------- Method for creating a Header cell
 public static TableCell CreateHeaderCell(string text, string tooltipText, int columnSpan, int rowSpan, int colWidth)
        {
            TableHeaderCell headerCell = new TableHeaderCell();
            headerCell.Text = text;
            headerCell.ToolTip = tooltipText;
            headerCell.ColumnSpan = columnSpan;
            headerCell.RowSpan = rowSpan;
            headerCell.Style.Add("text-align", "center");
            headerCell.Font.Bold = false;

            if (colWidth > 0)
            {
                headerCell.Width = colWidth;
            }
            return headerCell;
        }
--------------------------------------------------

Is it also possible to do same with Rad Grid?

Thanks in advance,
Ankur Mittal

Princy
Top achievements
Rank 2
 answered on 05 Mar 2010
1 answer
131 views
Hi,

I'm having a problem when im using ASP ScriptManager control with my update panel.

I have 3 update panels. 2 of them contains a radgrid. When i try to generate a server side event, the page refreshes but after that ... the page is locked.. i can't click a button, i can't write on a textbox etc..

Im using ASP:Scriptmanager, Scriptmanager proxy and 3 update panels, 2 of which has a radgrid in it.


Thanks
Red

Tsvetoslav
Telerik team
 answered on 05 Mar 2010
1 answer
70 views
Hi,

I am using a RadGrid with client-side binding, by implementing <ClientEvents OnDataBinding="RadGrid1_DataBinding" /> as explained in demos.
Now, I want to implement hierarchy in this RadGrid. How can I bind to another webservice method for the DetailedGrid ?
Tsvetoslav
Telerik team
 answered on 05 Mar 2010
4 answers
143 views

I made two small modifications to the default File Explorer Demo to test a problem I am having, and I was able to repeat the problem on it.
The issue is this:
I added a button to a page and a PreRender event to the file Explorer control on a page with the intention of updating the button text after the prerender event occurs on the file explorer. For some reason, if I upload a new file, the button text is updated as it should be, if I delete an existing file, the pre render event occurs, and the code to change the button text runs, but the text on the button is never updated. Why would I get this result?
/radcontrols_aspnetajax/fileexplorer/examples/default/defaultcs.aspx
take your existing file explorer default demo, and add a button above the text: "Browse to an image and double click to preview."

<asp:Button ID="btnSubmit" runat="server" Text="Submit" /> 
 
then add a PreRender to FileExplorer1:
        protected void FileExplorer1_PreRender(object sender, EventArgs e)  
        {  
            btnSubmit.Text += " | 1";  
        } 
If you put a break point on the text change, it will fire both on adding a new document and deleting an existing document, but the button text does not change on delete.

Is this a bug?
If not, how do I change the other controls on a page after an FileExplorer event?
Fiko
Telerik team
 answered on 05 Mar 2010
1 answer
131 views
I am using RadTools for ASP.NET 2009.Q3 SP2.

Can someone please tell me if the following possible.

I would like to build a user control (BaseGrid.ascx) that houses the Telerik RadGrid that will allow me to pass in different datasets to it based off of SQL views and or OpenAccess ORM ExtentClasses and have the grid display the columns/data automatically.  I am under the impression that the Grid's Auto Generate Columns at Runtime feature should do this however I have UNSUCCESSFULLY tried populating the grid using (OpenAccess)DirectSQL - OQL - LINQ and an OpenAccessDataSource(set at runtime).  When there are no errors then there simply in no data.

If I temporarily set the Grid's datasource to an OpenAccessDataSource and allow the columns to be built at design time then remove the DataSource but don't clear the Grid's schema then go back to dynamically setting the Grids datasource at runtime (with a method that usually results in a NO DATA TO DISPLAY message) it works and the data is there.  So for some reason the Auto Generate Columns At Runtime feature is not working.

The idea is to have a single code base for the Grid and dynamically set the columns and populate the data at runtime. 

Can someone please confirm and or point me in the right direction.

THANK YOU!
Mira
Telerik team
 answered on 05 Mar 2010
1 answer
158 views
I have a menu with z-index=7000, and a radwindowmanager with z-index=3000.

I need my menu be always on top of the windows, as the most .exe app.

But with a modal window I need this type of window be on top of everything, including the menu.

I create clientside via javascript the radwindows. How can I assign a z-index to my modal windows can be in top of everything, of course on top of other modal windows(previous ones), and the normal windows have their normal z-index under my radmenu?

Thanks.
Princy
Top achievements
Rank 2
 answered on 05 Mar 2010
1 answer
133 views
Hi

I have a fully functional Radgrid onto which I want to add the ability to resize. I have added the resizing attributes into the ClientSettings and when the grid renders, all I have is a black line down the side of the page. Here is the code with the offending resizing lines in bold. Can anyone tell me where I'm going wrong.

Thanks in Advance

Mark Robinson

 

<telerik:RadGrid ID="RadGrid1" AutoGenerateColumns="false" DataSourceID="LinqDataSource1"

 

AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True" runat="server" style="position:absolute; top:2000px; left:38px; " SkinID="None" >

 

 

 

<Headerstyle BackColor="LightSkyBlue" Font-Bold="True" ForeColor="Black"/>

 

 

 

<pagerstyle mode="NextPrevAndNumeric" BackColor="LightSkyBlue" />

 

 

 

<groupingsettings casesensitive="false" />

 

 

 

<AlternatingItemStyle BackColor="Gainsboro" />

 

 

 

<ItemStyle BackColor="#F9D295" />

 

 

 

<EditItemStyle BackColor="#F9D295" />

 

 

 <

SelectedItemStyle BackColor="Gold" />

 

 

 

<MasterTableView TableLayout="Auto" >

 

 

 

<Columns>

 

 

 

<telerik:GridBoundColumn UniqueName="ColPlanner"

 

 

 

SortExpression="Planner_Code" HeaderText="Planner Code" DataField="Planner_Code" ReadOnly="true">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn UniqueName="ColSupplier"

 

 

 

SortExpression="Supplier_Code" HeaderText="Supplier Code" DataField="Supplier_Code" ReadOnly="true">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn UniqueName="ColFamily"

 

 

 

SortExpression="Product_Family" HeaderText="Product Family" DataField="Product_Family" ReadOnly="true">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn UniqueName="ColPTC"

 

 

 

SortExpression="Part_Type_Code" HeaderText="Part Type Code" DataField="Part_Type_Code" ReadOnly="true">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn UniqueName="ColPartNumber"

 

 

 

SortExpression="Part_Number" HeaderText="Part Number" DataField="Part_Number" ReadOnly="true">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn UniqueName="ColPartDesc"

 

 SortExpression

="Part_Description" HeaderText="Part Description" DataField="Part_Description" ReadOnly="true">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn UniqueName="ColRule"

 

 

 

SortExpression="Rule" HeaderText="Rule" DataField="Rule" ReadOnly="true">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn UniqueName="ColTotalTarget"

 

 

 

SortExpression="Total_Inventory_Target" HeaderText="Total Inventory Target" DataField="Total_Inventory_Target" ReadOnly="true" DataFormatString="{0:F0}" >

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn UniqueName="ColBuffer"

 

 

 

SortExpression="Buffer_Inventory" HeaderText="Buffer Inventory" DataField="Buffer_Inventory" ReadOnly="true" DataFormatString="{0:F0}">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridNumericColumn UniqueName="ColInvTarget"

 

 

 

SortExpression="Inventory_Target" HeaderText="Inventory Target" DataField="Inventory_Target" DataFormatString="{0:F0}">

 

 

 

</telerik:GridNumericColumn>

 

 

 

<telerik:GridNumericColumn UniqueName="ColKanbanQty"

 

 

 

SortExpression="Kanban_Qty" HeaderText="Kanban Qty" DataField="Kanban_Qty" DataFormatString="{0:F0}">

 

 

 

</telerik:GridNumericColumn>

 

 

 

<telerik:GridNumericColumn UniqueName="ColNumberofRedKanbans"

 

 

 

SortExpression="Number_of_Red_Kanbans" HeaderText="Number of Red Kanbans" DataField="Number_of_Red_Kanbans" DataFormatString="{0:F0}">

 

 

 

</telerik:GridNumericColumn>

 

 

 

<telerik:GridNumericColumn UniqueName="ColNumberofYellowKanbans"

 

 

 

SortExpression="Number_of_Yellow_Kanbans" HeaderText="Number of Yellow Kanbans" DataField="Number_of_Yellow_Kanbans" DataFormatString="{0:F0}">

 

 

 

</telerik:GridNumericColumn>

 

 

 

<telerik:GridNumericColumn UniqueName="ColNumberofGreenKanbans"

 

 

 

SortExpression="Number_of_Green_Kanbans" HeaderText="Number of Green Kanbans" DataField="Number_of_Green_Kanbans" DataFormatString="{0:F0}">

 

 

 

</telerik:GridNumericColumn>

 

 

 

<telerik:GridBoundColumn UniqueName="ColLeadtimeInv"

 

 

 

SortExpression="Leadtime_Inventory" HeaderText="Leadtime Inventory" DataField="Leadtime_Inventory" ReadOnly="true" DataFormatString="{0:F0}">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn UniqueName="ColVariabilityMargin"

 

 

 

SortExpression="Variability_Margin" HeaderText="Variability Margin (Days)" DataField="Variability_Margin" ReadOnly="true" DataFormatString="{0:F0}">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn UniqueName="ColVariabilityPerc"

 

 

 

SortExpression="Variability_Perc" HeaderText="Variability Margin % of Leadtime" DataField="Variability_Perc" ReadOnly="true" DataFormatString="{0:F0}">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn UniqueName="ColComment"

 

 

 

SortExpression="Comment" HeaderText="Calculation Comment" DataField="Comment" ReadOnly="true">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn UniqueName="ColForecastType"

 

 

 

SortExpression="Forecast_Type" HeaderText="Forecast Type" DataField="Forecast_Type" ReadOnly="true">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn UniqueName="ColRuleName"

 

 

 

SortExpression="Rule_Name" HeaderText="Rule Name" DataField="Rule_Name" ReadOnly="true">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn UniqueName="ColDateCalculated"

 

 

 

SortExpression="Date_Calculated" HeaderText="Date Calculated" DataField="Date_Calculated" ReadOnly="true" DataFormatString="{0:d}">

 

 

 

</telerik:GridBoundColumn>

 

 

 

</Columns>

 

 

 

</MasterTableView>

 

 

 

<ClientSettings AllowColumnsReorder="true" ReorderColumnsOnClient="true">

 

 

 

<Resizing

 

 

 

AllowColumnResize="True"

 

 

 

AllowRowResize = "false"

 

 

 

ResizeGridOnColumnResize = "false"

 

 

 

ClipCellContentOnResize = "true"

 

 

 

EnableRealTimeResize = "false" />

 

 

 

</ClientSettings>

 

 

 

</telerik:RadGrid>

 

 

 

<asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="LinqToSql.LinqMonthShowAnalysisData"

 

 

 

TableName="wt107_Final_Inventory_Targets_Kanbans" AutoPage="true" AutoSort="true">

 

 

 

</asp:LinqDataSource>

 

 

 

 

 


Pavlina
Telerik team
 answered on 05 Mar 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?