Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
67 views
I hope I am missing something glaringly obvious, but I cannot find a sample or anything in the docs on how to obtain a reference in client-side for the controls in Advanced Templates.

Does anyone have a snippet?

Thanks,

Jim
Peter
Telerik team
 answered on 03 Nov 2009
5 answers
578 views

Here's my setup:  I have a MasterPage that has a webform with a RadGrid in it.  That RadGrid has one nested table.  I'm trying to insert a new item into that nested table using a WebUserControl (ascx) page as the EditForm for the nested Grid.

I've read the help at: http://www.telerik.com/help/aspnet-ajax/grdextractprimarykeyforparentiteminhierarchyonupdateinsert.html

My grid and nested grid are setup pretty much identically to what is there, except that I'm using a MasterPage and usercontrol for the form and I have a dataobject for the datasource.

When updating the nested grid with the usercontrol, the world is a wonderful place and things work just fine.  However, when that same form is used for inserting, the binding values go away.  In the customers and orders example, the customerID is not set to the default for the primarykey of the parent item.

I tried the code from http://www.telerik.com/help/aspnet-ajax/grdcustomeditforms.html for accessing the grid edited item from the usercontrol. 

GridEditableItem editedItem = this.Parent.NamingContainer; 

It generates a compiler error (cannot implictly convert system.web.ui.control to telerik.web.ui.GridEditableItem.  An explict conversion exists).  When I explictly cast, editedItem.KeyValues is null.  I think this may be something funky with the masterpages.

If parentID is an int32, I can use the following code in the main aspx code behind to get the appropriate value:

public int parentID {get; set;}
if
 (e.CommandName == RadGrid.InitInsertCommandName)  
            {  
                if (e.Item.OwnerTableView.DataSourceID == "OrderLookup")  
                {  
                    GridDataItem parentItem = (GridDataItem)(e.Item.OwnerTableView.ParentItem);  
                    if (parentItem != null)  
                    {  
                        parentID = (Convert.ToInt32((parentItem.OwnerTableView.DataKeyValues[parentItem.ItemIndex]["CustomerID"])));  
                    }  
                }  
            } 

But I can not for the life of me access that value from the ascx page.  I'm also assuming this is because of some masterpage stuff that I haven't figured out yet.

So, How can I reference that DataKeyValue from the WebUserControl for an insert function?  I need to set the default value for the customerID.  What is the best way to accomplish this?

David Kingston
Top achievements
Rank 2
 answered on 03 Nov 2009
1 answer
197 views
Hi,

In IE8 I get an unnecessary scrollbar in a RadListBox.

This does not happen when I use the compatible mode.
The RadListBox is in a RadPane of a RadSplitter. It is the only control in the RadPane and the height and width of the RadListBox are both set to 100%. (The RadPane is in my case typically around 300px high and 200px wide.)
When I inspect the rendered html with the developer tool and I change the the display style of the outermost div of the RadListBox control from 'inline-block' to 'block', the unnecessary scrollbar disappears, but I'm sure I shouldn't solve this problem by directly changing the rendered style. (Therefor I haven't tested if changing the style like this doesn't mess up things for the compatibility mode, so it might very well not be a good solution at all.)
I have looked for a property of which I would think it influences the style such that the problem is solved, but couldn't find one.

How do I get rid of the unnecessary scrollbar?

Regards,

Mink


Genady Sergeev
Telerik team
 answered on 03 Nov 2009
1 answer
104 views
I have a PopUp Edit Form (via Custom UserControl) where part of the UI design is calling for us to show a 'search' window - i.e. a Customer Lookup/Search Screen...

We have a visual control and place a button next to it and wire-up a simple server-side OnClick handler.  Even with the code-behind doing absolutely nothign other than a Debug.WriteLine() statement... The EditForm immediately closes...

How do I utlize additional 'buttons' on the form without it closing?

What we want the EditForm to really do when this button click occurs is to hide one DIV and show another where we can embed these type of 'search' mechanisms... And upon the search being completed/cancelled hide the DIV and restore the real EditForm div...

The other option being entertained is to show a RadWindow to host these search mechanism but the client preference is to avoid having more than 1 layer of popups going on... Additionally, I'm finding very little information on using RadWindow from code-behind - it seems to really be client-side focused... If we go with this route, I would like to use the RadWindow to show a UserControl rather than a Page - which doesn't sounds like an option from the little research I've done so far...
Iana Tsolova
Telerik team
 answered on 03 Nov 2009
1 answer
227 views
I'm making a dynamic RadDock structure as per this post. I want to react to changes in the RadDocks (add, move, close). Where is the best place to do this? From the RadDock Lifecycle I would gather that the best place to do this is in the RadDockLayout.SaveDockLayout-event, but I'm not sure.

Where is the best place to react to changes?


Pero
Telerik team
 answered on 03 Nov 2009
2 answers
133 views
Hi boys and girls,
  I'm having an issue with a RadGrid where the sorting mechanism wont alternate directions, after click the column name again.  Also, if I click the actual sorting arrow image, it changes the sorted column to the column to the right of it.  Lastly, the paging mechanism removes any sort that is applied to the RadGrid. 

I'm guessing these issues are all related, but I'm not sure what the cause is.  Currently I and handling the NeedDataSource event, and programmatically binding the grid depending on whether certain options are entered on the screen.  However, when sorting, these options don't change, so the issue shouldn't be that, but I'm not 100%.  Also, I don't have any advanced settings configured with the grid.  Just the columns definitions, sorting enabled, paging enabled, EnableRowHoverStyle, and EnablePostBackOnRowClick.  In fact, here is the markup:

<telerik:RadGrid runat="server" ID="uxRadGrid" AllowFilteringByColumn="False" GridLines="None" 
    Skin="Simple" AutoGenerateColumns="False" OnNeedDataSource="uxRadGrid_NeedDataSource" 
    OnItemCommand="uxRadGrid_ItemCommand" OnSortCommand="uxRadGrid_SortCommand"> 
    <MasterTableView DataKeyNames="id"  AllowPaging="True" 
        AllowSorting="True"> 
        <Columns> 
            <telerik:GridBoundColumn DataField="id" UniqueName="id" AutoPostBackOnFilter="true" 
                AllowFiltering="False" FilterControlWidth="30" AllowSorting="true" SortExpression="id" 
                HeaderText="Incident ID"> 
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="product" AutoPostBackOnFilter="true" AllowFiltering="False" 
                FilterControlWidth="40" AllowSorting="true" HeaderText="Product" SortExpression="product"> 
            </telerik:GridBoundColumn> 
            <telerik:GridDateTimeColumn DataField="comment" DataFormatString="{0:yyyy-MM-dd}" 
                AutoPostBackOnFilter="true" FilterControlWidth="40" AllowFiltering="false" AllowSorting="true" 
                HeaderText="Date" SortExpression="comment"> 
            </telerik:GridDateTimeColumn> 
            <telerik:GridBoundColumn DataField="description" AutoPostBackOnFilter="true" AllowFiltering="False" 
                AllowSorting="true" SortExpression="description" HeaderText="Description" ItemStyle-Width="50%"> 
                <ItemStyle Width="50%" /> 
            </telerik:GridBoundColumn> 
        </Columns> 
        <RowIndicatorColumn> 
            <HeaderStyle Width="20px" /> 
        </RowIndicatorColumn> 
        <ExpandCollapseColumn> 
            <HeaderStyle Width="20px" /> 
        </ExpandCollapseColumn> 
    </MasterTableView> 
    <ClientSettings EnableRowHoverStyle="true" EnablePostBackOnRowClick="true"></ClientSettings> 
    <FilterMenu EnableTheming="True"> 
        <CollapseAnimation Duration="200" Type="OutQuint" /> 
    </FilterMenu> 
</telerik:RadGrid> 


Any ideas?  Thanks in advance!
Sebastian
Telerik team
 answered on 03 Nov 2009
1 answer
100 views
How can I create blank spaces/gaps between vertical docks in a dockzone? It won't let me add a <BR>.

Thanks!
Pero
Telerik team
 answered on 03 Nov 2009
2 answers
219 views
Hi Guys,

Seems "Filter" event is fired only when you filter using menu and mouse.
When you press enter in filter textboxes - seems nothing happens.

I need to collapse all my nested items before filtering my client-side bound grid.
Can you please advise the best way how to achieve my goal ?

Oleg Medyanik
Top achievements
Rank 1
 answered on 03 Nov 2009
1 answer
149 views
WebUserControl1 has:
<script type="text/javascript">
        function SetInterval()
        {
            var panel = $find("<%=RadXmlHttpPanel1.ClientID%>");
            panel.set_value("yes");
        }
    </script>
    <br />
    <input type="button" value="Start Timer" onclick="SetInterval()" />
<telerik:RadXmlHttpPanel ID="RadXmlHttpPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1"
            OnServiceRequest="RadXmlHttpPanel1_ServiceRequest">
            <asp:Label ID="Label1" runat="server" Text="Timer Not Started"></asp:Label>
 </telerik:RadXmlHttpPanel>

This works, from the Page_Load adding the control:
protected void Page_Load(object sender, EventArgs e)
    {
           this.place.Controls.Add(LoadControl("WebUserControl1.ascx"));
    }

This doesn't on a tab click adding the control and alerts "XmlHttpPanel Callback Loading error:
 Exception=The target 'ctl01$RadXmlHttpPanel1' for the callback could not be found or did not implement ICallbackEventHandler.":

protected void Page_Load(object sender, EventArgs e)
 {
            grantTabs.TabClick += new RadTabStripEventHandler(grantTabs_TabClick);
 }

void grantTabs_TabClick(object sender, RadTabStripEventArgs e)
{
        this.place.Controls.Add(LoadControl("WebUserControl1.ascx"));
 }

--------------------------------------------------------------------
Just making the control load on the tab click stops the XmlHttpPanel from working.

<telerik:RadTabStrip 
        runat="server" 
        ID="grantTabs" 
        Skin="Default">
        <Tabs>
            <telerik:RadTab runat="server" Text="Overview" PageViewID="overview" Selected="true" />
            <telerik:RadTab runat="server" Text="Activities" PageViewID="activities" />
          </Tabs>
    </telerik:RadTabStrip>
    <div class="tab_container">
        <asp:PlaceHolder ID="place" runat="server" />
        <div style="clear: both;">&nbsp;</div>
    </div>

Is this a bug or is there a work around?
Thanks

Pero
Telerik team
 answered on 03 Nov 2009
1 answer
192 views
Hi,

I am using the telerik rad grid to display a hierarchical grid to the users. The grid is bound to a dataset with both data tables for the master and detail view. Following is the code for the grid:
---------------------------------------------------------------------------------------------------------------------------------------------------------------
<radG:EMGrid ID="radUserTypesGrid" runat="server" Width="95%" AutoGenerateColumns="False"
            AllowPaging="True" EnableAJAX="True" GridLines="None" AllowExport="true" AllowMultiRowSelection="True">
            <ExportSettings ExportOnlyData="true" FileName="Group User Types" />
            <ClientSettings AllowExpandCollapse="True">
                <Selecting AllowRowSelect="true" />
            </ClientSettings>
            <MasterTableView Name="GroupAdminUserType" DataKeyNames="UserTypeID" HierarchyLoadMode="Client"
                Width="100%">
                <NoRecordsTemplate>
                    <div class="noRecords">
                        <asp:Label runat="server" ID="lblMasterError">No User Types are available.</asp:Label>
                        <br />
                    </div>
                </NoRecordsTemplate>
                <DetailTables>
                    <radG:GridTableView Name="GroupAdminUserJobType" DataKeyNames="UserTypeID" HierarchyLoadMode="Client"
                        Width="100%" runat="server">
                        <ParentTableRelation>
                            <radG:GridRelationFields DetailKeyField="UserTypeID" MasterKeyField="UserTypeID" />
                        </ParentTableRelation>
                        <NoRecordsTemplate>
                            <div class="noRecords">
                                <asp:Label runat="server" ID="lblChildError">No Job Types are available.</asp:Label>
                                <br />
                            </div>
                        </NoRecordsTemplate>
                        <Columns>
                            <radG:GridTemplateColumn UniqueName="DummyColumn">
                                <ItemTemplate>
                                </ItemTemplate>
                                <ItemStyle Width="30px" />
                            </radG:GridTemplateColumn>
                            <radG:GridClientSelectColumn UniqueName="chkUserJobType">
                                <HeaderStyle Width="5px" HorizontalAlign="Left" />
                                <ItemStyle Width="5px" HorizontalAlign="Left" VerticalAlign="Middle" />
                            </radG:GridClientSelectColumn>
                            <radG:GridBoundColumn HeaderText="" DataField="UserTypeID" UniqueName="UserTypeID"
                                Visible="false" />
                            <radG:GridBoundColumn HeaderText="" DataField="JobTypeID" UniqueName="JobTypeID"
                                Visible="false" />
                            <radG:GridBoundColumn HeaderText="Job Type" DataField="JobType" UniqueName="JobType" />
                            <radG:GridBoundColumn HeaderText="" DataField="Status" UniqueName="Status" Visible="false" />
                        </Columns>
                        <ExpandCollapseColumn Visible="False" />
                        <RowIndicatorColumn Visible="False" />
                    </radG:GridTableView>
                </DetailTables>
                <Columns>                    
                    <radG:GridClientSelectColumn UniqueName="chkUserType">
                        <HeaderStyle Width="10%" HorizontalAlign="Left" />
                        <ItemStyle Width="10%" HorizontalAlign="Left" VerticalAlign="Middle" />
                    </radG:GridClientSelectColumn>
                    <radG:GridBoundColumn HeaderText="" DataField="UserTypeID" UniqueName="UserTypeID"
                        Visible="false" />
                    <radG:GridBoundColumn HeaderText="" DataField="UserType" UniqueName="UserType" />
                    <radG:GridBoundColumn HeaderText="" DataField="Status" UniqueName="Status" Visible="false" />
                </Columns>
                <PagerStyle Mode="NextPrevAndNumeric" HorizontalAlign="Center" />
                <ExpandCollapseColumn />
                <RowIndicatorColumn Visible="False" />
            </MasterTableView>
        </radG:EMGrid>
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
I am using the first column as GridClientSelectColumn for displaying checkbox column to the grid. The grid has a status column each for the master and detail view. The status column is used to set the GridClientSelectColumn check box check/uncheck state. I use the item databound event to check for the status value and check/uncheck the check box. On load, the grid is bound to the dataset and the check boxes are set properly - no issues at all (Please see the screenshot # 1). The problem is when I try to deselect a bound check box. As I uncheck the checkbox, the alignment gets disturbed and the screen looks very ugly (see screenshot # 2 for more details). I have tried to set the width of the columns and other options but no luck.

Please assist me with this issue.

Thanks,
Vaibhav Modak
Martin
Telerik team
 answered on 03 Nov 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?