Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
113 views
We have a 4 layer hierarchy RAD Grid (1 MasterTableView and 3 GridTableView).  The MasterTableView shows the "Divisions" information, the 1st hierarchy GridTableView shows "Sites", the 2nd hierarchy GridTableView shows "Accounts", and the 3rd hierarchy shows "Fiscal Year" information.  We can show each layer by expanding/collapsing the rows.  We use advanced data binding methods (NeedDataSource for the MasterTableView and DetailTableDataBind for the 3 GridTableViews).  We use several stored procedures to get the data from the database.  This is working as designed.  Each Division can have multiple Sites.  And each Site can have multiple Accounts. The current grid resembles the following:

Division
    Sites
        Accounts
            Fiscal Year Info

We want to be able to load ALL of the Divisions and All of the corresponding Sites at the same time and expand the Divisions to show the Sites.  In other words, we want to display the MasterTableView and the 1st GridTableView using one stored procedure that gets the Divisions and all of the corresponding Sites for that Division. The Division needs to be in the MasterTableView and the Sites need to be in the 1st hierarchy GridTableView so that end-users could expand/collapse out the Divisons/Sites if needed. We want the grid to resemble the following:

Division 1
    Site 1 (for Division 1)
    Site 2 (for Division 1)
Division 2
    Site 1 (for Division 2)
    Site 2 (for Division 2)
    Site 3 (for Division 2)

Currently, we get the information back from the database using 1 stored procedure but ONLY the MasterTableView is visible and it has both the Divisions and Sites in it.  Could you please provide some assistance on how to accomplish this?
Georgi Krustev
Telerik team
 answered on 16 Mar 2009
1 answer
142 views
Hi,

we are using RadGrid control hosted in a ModalPopupExtender part of AjaxToolKit. Everything is fine except the context menu for filter option. The context menu is displayed under the modal popup. we tried to put the rad grid inside a div with a zorder bigger the zorder of the modal popup extender but it didn't worked.
There is a workaround for this issue?

Best regards
Georgi Krustev
Telerik team
 answered on 16 Mar 2009
2 answers
286 views

I have a button inside a user web control (.ascx) that does the postback.  I would like the grid to refresh on the postback of the button click.  Therefore, I refresh the grid in the aspx’s Page_Load:

        if (IsPostBack)

            Grid1.Rebind();

I also added validateRequest="false" EnableEventValidation="false" to <%@ Page%> to supress the invalid postback exception.  This did refresh my grid on the web control button click postback.  However, when I put the grid item in edit mode, none of the events in the edit form was fired, such as button click or combo’s selection change.   I am guessing this is because Grid1.Rebind(); in Page_Load  cause ItemDataBound event raised when an event was fired in the edit form.  Here is my ItemDataBound handler:

    protected void Grid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
    {
        if (e.Item is GridEditableItem && e.Item.IsInEditMode)
        {
            GridEditableItem editedItem = e.Item as GridEditableItem;
            MyCombo combo = editedItem.FindControl("myCombo") as MyCombo;
            combo.UserName = UserName;
            combo.DataBind();
        }
    }

 Please help. Thanks,

Peichung
Top achievements
Rank 1
 answered on 16 Mar 2009
1 answer
60 views
Hi,
  I was refering to some example of hierarchical grid at "http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/nestedviewtemplate/defaultcs.aspx".

One of the code line is as shown below bolded.

    protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridNestedViewItem)
            {
                e.Item.FindControl("InnerContainer").Visible = ((GridNestedViewItem)e.Item).ParentItem.Expanded;
            }
        }

When have this particular piece of code in my application it's throwing compilation error.

I am using "2008.2 1001" version of telerik dlls.

Do let me know the work around
Sebastian
Telerik team
 answered on 16 Mar 2009
2 answers
144 views
Hi,
I would like to freeze the commandItemTemplate row to be always on top and won't disappear while scrolling.
Can anyone advice how to to that?


Thanks,
Ruth.

Ruth Dahan
Top achievements
Rank 1
 answered on 16 Mar 2009
6 answers
140 views
Hi guys,

I'm facing a really weird window problem.
I open a window, I close the window.

All controls on the page that were covered by the window are now unaccessible.
Controls that were not covered by the window are still accessible.
If I move the window around before closing it, then the controls that were behind the window when it was closed are unaccessible.

So it seems definitely linked to window position on closing.
And it's absolute, if the window covers half a textbox, then I can get focus to the texbox by placing the cursor in the other half, while the half that was covered by the window is ... yes you guessed it, unaccessible.

The content itself in the window doesn't seem to matter. I tried using an empty window and the result was the same.

Please note that (at least in my project) this is a global problem with the window and applies to all browsers.
I've tested this in IE, FF, Opera, Chrome and Safari.

I double checked this by updating another project to Q1 2009, and the result is the same there.

Regards,
-DJ-

-DJ-
Top achievements
Rank 1
 answered on 16 Mar 2009
1 answer
177 views
Can someone please help me with this?

Here is my error
 

Server Error in '/new broker' Application.

Cannot insert the value NULL into column 'BusinessTypeID', table 'ASPNETDB.dbo.ProducerBusinessType'; column does not allow nulls. INSERT fails.
The statement has been terminated.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Cannot insert the value NULL into column 'BusinessTypeID', table 'ASPNETDB.dbo.ProducerBusinessType'; column does not allow nulls. INSERT fails.
The statement has been terminated.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[SqlException (0x80131904): Cannot insert the value NULL into column 'BusinessTypeID', table 'ASPNETDB.dbo.ProducerBusinessType'; column does not allow nulls. INSERT fails.
The statement has been terminated.]
   System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +1950890
   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4846875
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194
   System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2392
   System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +204
   System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +954
   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +162
   System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +175
   System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +137
   System.Web.UI.WebControls.SqlDataSourceView.ExecuteDbCommand(DbCommand command, DataSourceOperation operation) +386
   System.Web.UI.WebControls.SqlDataSourceView.ExecuteInsert(IDictionary values) +227
   System.Web.UI.DataSourceView.Insert(IDictionary values, DataSourceViewOperationCallback callback) +86
   Telerik.Web.UI.GridTableView.PerformInsert(GridEditableItem editedItem, Boolean suppressRebind) +281
   Telerik.Web.UI.GridTableView.PerformInsert(GridEditableItem editedItem) +41
   Telerik.Web.UI.GridTableView.PerformInsert() +65
   Telerik.Web.UI.GridCommandEventArgs.ExecuteCommand(Object source) +5486
   Telerik.Web.UI.RadGrid.OnBubbleEvent(Object source, EventArgs e) +191
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   Telerik.Web.UI.GridItem.OnBubbleEvent(Object source, EventArgs e) +61
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   Telerik.Web.UI.GridItem.OnBubbleEvent(Object source, EventArgs e) +165
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   System.Web.UI.WebControls.ImageButton.OnCommand(CommandEventArgs e) +111
   System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +176
   System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565



Here is my code

 

<telerik:RadGrid ID="rgBizTypePercent" runat="server" Skin="Vista"

 

 

AutoGenerateColumns="False" DataSourceID="sdsBizTypePercentages"

 

 

AllowAutomaticInserts="true"

 

 

GridLines="None">

 

 

 

<HeaderContextMenu>

 

 

<CollapseAnimation Duration="200" Type="OutQuint" />

 

 

</HeaderContextMenu>

 

 

<MasterTableView EditMode="InPlace" DataKeyNames="ID"

 

 

CommandItemDisplay="Top" DataSourceID="sdsBizTypePercentages">

 

 

 

<Columns>

 

 

<telerik:GridEditCommandColumn ButtonType="ImageButton" Display="true"

 

 

Visible="true">

 

 

 

</telerik:GridEditCommandColumn>

 

 

<telerik:GridDropDownColumn DataSourceID="sdsBizType"

 

 

HeaderText="Business Type" ListTextField="Description"

 

 

ListValueField="BusinessTypeID" DataType="System.Int32"

 

 

UniqueName="BusinessTypeID">

 

 

</telerik:GridDropDownColumn>

 

 

<telerik:GridDropDownColumn DataSourceID="sdsPercent"

 

 

HeaderText="Business Percent" ListTextField="perc"

 

 

ListValueField="id" DataType="System.Int32"

 

 

UniqueName="Amount">

 

 

</telerik:GridDropDownColumn>

 

 

</Columns>

 

 

<EditFormSettings>

 

 

<EditColumn UniqueName="EditCommandColumn1">

 

 

</EditColumn>

 

 

</EditFormSettings>

 

 

</MasterTableView>

 

 

<FilterMenu>

 

 

<CollapseAnimation Duration="200" Type="OutQuint" />

 

 

</FilterMenu>

 

 

</telerik:RadGrid>

 

 

<asp:SqlDataSource ID="sdsBizTypePercentages" runat="server"

 

 

ConnectionString="<%$ ConnectionStrings:BROKERConnectionString %>"

 

 

SelectCommand="SELECT * FROM [ProducerBusinessType]"

 

 

DeleteCommand="DELETE FROM [ProducerBusinessType] WHERE [ProducerID] = @ProducerID AND [BusinessTypeID] = @BusinessTypeID"

 

 

InsertCommand="INSERT INTO [ProducerBusinessType] ([ProducerID], [BusinessTypeID], [Amount]) VALUES (@ProducerID, @BusinessTypeID, @Amount)"

 

 

UpdateCommand="UPDATE [ProducerBusinessType] SET [ID] = @ID, [Amount] = @Amount WHERE [ProducerID] = @ProducerID AND [BusinessTypeID] = @BusinessTypeID">

 

 

<InsertParameters>

 

 

<asp:SessionParameter Name="ProducerID" DefaultValue="100000" SessionField="ProducerID" Type="Int32" />

 

<%

--<asp:Parameter Name="ProducerID" Type="Int32" />--%>

 

 

<asp:FormParameter FormField="BusinessTypeID" Name="BusinessTypeID" Type="Int32" />

 

 

<asp:FormParameter FormField="Amount" Name="Amount" Type="Int32" />

 

 

 

</InsertParameters>

 

 

</asp:SqlDataSource>

 

 

<asp:SqlDataSource ID="sdsPercent" runat="server"

 

 

ConnectionString="<%$ ConnectionStrings:BROKERConnectionString %>"

 

 

SelectCommand="SELECT * FROM [LookupPercent]"></asp:SqlDataSource>

 

Tsvetoslav
Telerik team
 answered on 16 Mar 2009
1 answer
165 views
Hi All,

I've pivotted my data in my datasource (web service) and therefore I don't know how many columns I will have (or what their names will be) except the first few.

This thread was helpful -- http://www.telerik.com/community/forums/aspnet/grid/multi-row-edit-in-grid.aspx -- but it doesn't cover my situation as they have explicitly set the editItemTemplate, which I can't do.

I was able to get checkboxes in all of my cells(that's the goal) using the radgrid_ItemDataBound event and just cycling through all the columns adding the checkbox to the controls collection for each cell.  That feels dirty.  And, in my radgrid_ItemCommand event I'm not getting any data from the checkboxes anyway.

Can someone give me a tip to get rolling? 
I think I have two questions.
1) How SHOULD I be getting those checkboxes in there (all cells get one)
2) How do I get the data back.
Note that the columns are all automatically generated.
Thanks for any tips.
Tom B.
Sebastian
Telerik team
 answered on 16 Mar 2009
3 answers
328 views
I use a GridTemplateColumn in the RadGrid and now I have to insert icons in this columns, edpending of the flag field in the datatable.

How can I realize this?

thanks for assistance

Christian 
Christian
Top achievements
Rank 1
 answered on 16 Mar 2009
1 answer
108 views
In line charts, they seem to be centered with padding to the edge of the chart:
http://demos.telerik.com/aspnet-ajax/chart/examples/skinning/lines/defaultcs.aspx

Is there a way to make the line flushed to the edges?



Dessy
Telerik team
 answered on 16 Mar 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?