Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
306 views
I am struggling with understanding what event args to use for the DataGrid EditForm.  I appear to either not have the correct OnItemCommand or OnUpdatedCommand in combination with the correct event args.   All the examples I have seen do not have good examples of the EditForm and doing the updates in a code behind using a web service.

<radgrid>
    <mastertableview>
        <columns>
            <telerik bound column>
        </columns>
        <editformsettings>
            <formtemplate>
                <my form items>
                <my button with command name update>                
            </formtemplate>
        </editformsettings>
    </mastertableview>
</radgrid>

I have the following in my radgrid:
OnItemCommand="RadgridItem_Update"

In have the following in my code behind:
protected void RadgridItem_Update(object sender, GridCommandEventArgs e)
    {
        GridEditFormItem myitem = (GridEditFormItem)e.Item;
        etc. etc.  call web service update.
    }

Karl Rohrbach
Top achievements
Rank 1
 answered on 08 Feb 2011
1 answer
85 views
I implimented the DBSchedulerProviderBase per your sample and it works fine for multi-resource items.  What I am trying to figure out now is how to filter it, since the SQL Logic is hardcoded into the GetAppointments method.  I have two comboboxes above the schedule that when I change those items, it should filter the appointments shown.  But I am unsure of how to do that when the select statement is hardcoded into the GetAppointments Method
Peter
Telerik team
 answered on 08 Feb 2011
7 answers
158 views
Hello,

Our users have a very large appointment calendar, and the confirmation for deleting appointments appears out of range because it's centered within the control, and they have many browser pages of appointments, and so the confirmation appears out of range.  Can you control where that scheduler confirmation appears?

Thanks.
Peter
Telerik team
 answered on 08 Feb 2011
1 answer
50 views
hi, this is what adding the <AdvancedInsertTemplate>, but I removed the other items, I want is just add it without deleting the other items that are:
subject, start, end, recurrence, etc..

Thanks for your help
Peter
Telerik team
 answered on 08 Feb 2011
1 answer
46 views
Is Telerik thinking about a standalone PDF control for ASP.NET?
Would be a good thing to have PDF export functionality not ony in a few controls but as it's own control.

So, any plans?

Regards

Thomas
Sebastian
Telerik team
 answered on 08 Feb 2011
1 answer
153 views
Hi All,

I have a static RadDockZone nested inside of a RadPane. The RadDockZone's height is unset, but its minHeight is set to 100%. I am following this advice based off of a discussion with Pero here.

On initial page load the RadDockZone's height is slightly too large -- The same issue that I was having here. Unfortunately, the solution is not the same -- if I do not have minHeight set to 100% then the RadDockZone does not attempt to fill the entire space that is nested inside. If Telerik has a suggestion on how to achieve both of these results at the same time that would be appreciated.

Thanks for the help,

Sean
Pero
Telerik team
 answered on 08 Feb 2011
6 answers
225 views
Hello,

I'm creating a RadGrid from code-behind. I've got a client-side row selection event (which causes a postback) and I'd like to use the InPlace edit mode of the grid. The problem is when the grid is in edit mode, I can still select rows client-side and cause a postback.

So my question is if I can somehow prevent client-side row selections when there's an editable row in the grid?

I'm not sure if this is related, but I found an old post on this forum about the InPlace edit mode and using the OnRowSelected client event:
http://www.telerik.com/community/forums/aspnet/grid/handle-onrowselected-client-event-when-the-item-was-been-editting.aspx

A post from Telerik states:
After further investigation this seems to be a limitation of the InPlace edit mode. When working in this mode the column can not be selected. As a workaround I can suggest you to see the implementation of server-side selection in this example which might give you a hint on how to achieve your goal.
Source: http://www.telerik.com/community/forums/aspnet/grid/handle-onrowselected-client-event-when-the-item-was-been-editting.aspx#639338

Is that post still relevant today? Either way, the original question still stands!

Regards,
Reggy
Iana Tsolova
Telerik team
 answered on 08 Feb 2011
6 answers
276 views

I had this working, but someone I broke it. When I use the autogenerated update, cancel and delete links, they hang. The edit link opens the edit form with no issues.

This seems  to start when I tried to create the columns on my own. I wanted to change the link to a image button.

My code is below:

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default">
</telerik:RadAjaxLoadingPanel>
<telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="QUARK_PEERING" GridLines="None"
    ShowStatusBar="True" AllowPaging="True" Skin="Web20" Width="920px"  OnItemUpdated="RadGrid1_ItemUpdated"
    OnItemDeleted="RadGrid1_ItemDeleted" OnItemInserted="RadGrid1_ItemInserted" OnDataBound="RadGrid1_DataBound"
    AutoGenerateDeleteColumn="True" AutoGenerateEditColumn="True" AutoGenerateHierarchy="True" AllowAutomaticDeletes="True"
    AllowAutomaticInserts="True" AllowAutomaticUpdates="True">
    <PagerStyle Mode="NextPrevNumericAndAdvanced"></PagerStyle>
    <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True">
        <Selecting AllowRowSelect="True" />
        <Scrolling AllowScroll="True" UseStaticHeaders="True" />
    </ClientSettings>
    <AlternatingItemStyle BackColor="#DCE5BF" />
    <MasterTableView AutoGenerateColumns="false" DataSourceID="QUARK_PEERING" DataKeyNames="ASN"
        CommandItemDisplay="Top" Name="Peers" AllowFilteringByColumn="True">
        <CommandItemSettings ExportToPdfText="Export to Pdf" ShowExportToPdfButton="True"
            ShowAddNewRecordButton="True" ShowExportToCsvButton="True" ShowExportToExcelButton="True"
            ShowExportToWordButton="True"></CommandItemSettings>
        <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
        </RowIndicatorColumn>
        <ExpandCollapseColumn Visible="True">
        </ExpandCollapseColumn>
        <DetailTables>
            <telerik:GridTableView runat="server" CommandItemDisplay="Top" DataSourceID="QUARK_PEERING2"
                AutoGenerateColumns="false" DataKeyNames="ID" Name="Peerings" AllowPaging="True"
                PageSize="3">
                <ParentTableRelation>
                    <telerik:GridRelationFields DetailKeyField="ASN" MasterKeyField="ASN" />
                </ParentTableRelation>
                <Columns>
                    <telerik:GridBoundColumn DataField="ASN" HeaderText="ASN" SortExpression="ASN" UniqueName="ASN"
                        HeaderStyle-Width="45px">
                        <HeaderStyle Width="45px"></HeaderStyle>
                    </telerik:GridBoundColumn>
                    <telerik:GridDropDownColumn DataField="EXCHANGE_ID" DataSourceID="QUARK_EXCHANGES"
                        HeaderText="Exchange" ListTextField="EXCHANGE_NAME" ListValueField="EXCHANGE_ID"
                        UniqueName="EXCHANGE_ID" ColumnEditorID="GridDropDownColumnEditor1">
                    </telerik:GridDropDownColumn>
                    <telerik:GridBoundColumn DataField="IPv4_IP_01" HeaderText="IPv4 Peer IP 1" SortExpression="IPv4_IP_01"
                        UniqueName="IPv4_IP_01" HeaderStyle-Width="100px">
                        <HeaderStyle Width="100px"></HeaderStyle>
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="IPv4_IP_02" HeaderText="IPv4 Peer IP 2" SortExpression="IPv4_IP_02"
                        UniqueName="IPv4_IP_02" HeaderStyle-Width="100px">
                        <HeaderStyle Width="100px"></HeaderStyle>
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="IPv6_IP_01" HeaderText="IPv6 Peer IP 1" SortExpression="IPv6_IP_01"
                        UniqueName="IPv6_IP_01" HeaderStyle-Width="150px">
                        <HeaderStyle Width="150px"></HeaderStyle>
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="IPv6_IP_02" HeaderText="IPv6 Peer IP 2" SortExpression="IPv6_IP_02"
                        UniqueName="IPv6_IP_02" HeaderStyle-Width="150px">
                        <HeaderStyle Width="150px"></HeaderStyle>
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="MAX_PREFIX" HeaderText="Maximum # of Prefixes"
                        SortExpression="MAX_PREFIX" UniqueName="MAX_PREFIX" Visible="False">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="CURRENT_PREFIX" HeaderText="Current # of Prefixes"
                        SortExpression="CURRENT_PREFIX" UniqueName="CURRENT_PREFIX" HeaderStyle-Width="75px">
                        <HeaderStyle Width="75px"></HeaderStyle>
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="MD5_PASSWORD" HeaderText="Peering Password" SortExpression="MD5_PASSWORD"
                        UniqueName="MD5_PASSWORD" Visible="False">
                    </telerik:GridBoundColumn>
                </Columns>
                <CommandItemSettings ShowAddNewRecordButton="True"></CommandItemSettings>
                <RowIndicatorColumn>
                    <HeaderStyle Width="20px" />
                </RowIndicatorColumn>
                <ExpandCollapseColumn>
                    <HeaderStyle Width="20px" />
                </ExpandCollapseColumn>
                <EditFormSettings>
                    <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                    </EditColumn>
                </EditFormSettings>
            </telerik:GridTableView>
        </DetailTables>
        <Columns>
            <telerik:GridBoundColumn DataField="COMPANY_NAME" HeaderText="Network Name" SortExpression="COMPANY_NAME"
                UniqueName="COMPANY_NAME">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="ASN" HeaderText="ASN" SortExpression="ASN" UniqueName="ASN">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="PRIMARY_CONTACT" HeaderText="Primary Contact"
                SortExpression="PRIMARY_CONTACT" UniqueName="PRIMARY_CONTACT" Visible="False">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="PRIMARY_EMAIL" HeaderText="Primary Email" SortExpression="PRIMARY_EMAIL"
                UniqueName="PRIMARY_EMAIL" Visible="False">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="PRIMARY_NUMBER" HeaderText="Primary Email" SortExpression="PRIMARY_NUMBER"
                UniqueName="PRIMARY_NUMBER" Visible="False">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="SUPPORT_CONTACT" HeaderText="Support Contact"
                SortExpression="SUPPORT_CONTACT" UniqueName="SUPPORT_CONTACT" Visible="False">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="SUPPORT_EMAIL" HeaderText="Support Email" SortExpression="SUPPORT_EMAIL"
                UniqueName="SUPPORT_EMAIL" Visible="False">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="SUPPORT_NUMBER" HeaderText="Support Number" SortExpression="SUPPORT_NUMBER"
                UniqueName="SUPPORT_NUMBER" Visible="False">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="PEERING_CONTACT" HeaderText="Peering Contact"
                SortExpression="PEERING_CONTACT" UniqueName="PEERING_CONTACT" Visible="False">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="PEERING_EMAIL" HeaderText="Peering Email" SortExpression="PEERING_EMAIL"
                UniqueName="PEERING_EMAIL" Visible="False">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="PEERING_NUMBER" HeaderText="Peering Number" SortExpression="PEERING_NUMBER"
                UniqueName="PEERING_NUMBER" Visible="False">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="PEERING_DB_LINK" HeaderText="PeeringDB Link"
                SortExpression="PEERING_DB_LINK" UniqueName="PEERING_DB_LINK" Visible="false">
            </telerik:GridBoundColumn>
        </Columns>
        <EditFormSettings>
            <EditColumn FilterControlAltText="Filter EditCommandColumn column">
            </EditColumn>
        </EditFormSettings>
    </MasterTableView>
    <PagerStyle Mode="NextPrevNumericAndAdvanced" />
    <FilterMenu EnableImageSprites="False">
    </FilterMenu>
    <HeaderContextMenu>
        <ExpandAnimation Type="OutBounce" />
    </HeaderContextMenu>
</telerik:RadGrid>
<telerik:GridDropDownListColumnEditor ID="GridDropDownColumnEditor1" runat="server"
    DropDownStyle-Width="110px" />
Tsvetoslav
Telerik team
 answered on 08 Feb 2011
6 answers
488 views
Hello!

I have built a grid report with edit and insert feature. so far everything is fine except for validation which I will do it next and the problem I face below:

I have two fileds --SID and Username ( we are not talking about database design problem here) which are related. so one sid to one username ( unique).

I have hidden sid and username in Edit form and use ForceExtractValue="InEditMode" which works in insert and edit. I used codebehind to hide them in edit mode and show them in insert mode.
    protected void RadGrid3_ItemCommand(object source, GridCommandEventArgs e)  
    {  
        ///I have to hide the fields SID and Username in the edit mode but show them in the insert mode ///  
        RadGrid grid = (source as RadGrid);  
        if (e.CommandName == RadGrid.InitInsertCommandName)  
        {  
            grid.MasterTableView.ClearEditItems();  
            RadGrid3.MasterTableView.GetColumn("SID").EditFormHeaderTextFormat = "SID:";  
            RadGrid3.MasterTableView.GetColumn("Username").EditFormHeaderTextFormat = "Username:";  
        }  
        if (e.CommandName == RadGrid.EditCommandName)  
        {  
            e.Item.OwnerTableView.IsItemInserted = false;  
            RadGrid3.MasterTableView.GetColumn("SID").EditFormHeaderTextFormat = "";  
            RadGrid3.MasterTableView.GetColumn("Username").EditFormHeaderTextFormat = "";  
        }    
 
        ///show export  
        if (e.CommandName == Telerik.Web.UI.RadGrid.ExportToExcelCommandName ||  
            e.CommandName == Telerik.Web.UI.RadGrid.ExportToWordCommandName ||  
            e.CommandName == Telerik.Web.UI.RadGrid.ExportToCsvCommandName ||  
            e.CommandName == Telerik.Web.UI.RadGrid.ExportToPdfCommandName)  
        {  
            ConfigureExport();  
        }  
    }  
 
    protected void RadGrid3_ItemDataBound(object sender, GridItemEventArgs e)  
    {  
        // update form     
        if (e.Item is GridEditFormItem && e.Item.IsInEditMode && e.Item.OwnerTableView.IsItemInserted == false)  
        {  
            GridEditFormItem editFormItem = (GridEditFormItem)e.Item;  
            editFormItem["SID"].Visible = false;  
            editFormItem["Username"].Visible = false;  
        }  
        // insert     
        else if (e.Item is GridEditFormInsertItem && e.Item.IsInEditMode && e.Item.OwnerTableView.IsItemInserted == true)  
        {  
            RadGrid3.MasterTableView.ClearEditItems();  
        }    
 
    } 


Now I want to when user input anything in sid or username field the other field is field with right data.
Or I want to hide sid and only show username in Insert mode. when user input username and I will get sid from database and add the value into the sid insert parameter then do insert.

How could I accomplish this.

Helmy
Top achievements
Rank 1
 answered on 08 Feb 2011
1 answer
215 views

I am trying to pass an ItemTemplate from an instance of a user control to a ListView ItemTemplate in a user control.

------------------- USER CONTROL .ASCX.CS -------------------
    [TemplateContainer(typeof(ItemTemplateContainer))]
    [PersistenceMode(PersistenceMode.InnerProperty)]
    [TemplateInstance(TemplateInstance.Single)]
    public ITemplate ItemTemplate { get; set; }
    public class ItemTemplateContainer : Control, INamingContainer { }

    protected void Page_Init()
    {
        if (ItemTemplate != null)
        {
            ItemTemplateContainer container = new ItemTemplateContainer();
            ItemTemplate.InstantiateIn(container);
            //THIS IS WHERE I AM STUCK - HOW DO I ASSIGN THE TEMPLATE FROM .ASPX TO THE RADLISTVIEW HERE?
        }
        else
            //If no custom template specified load default
            RadListView1.ItemTemplate = Page.LoadTemplate("/someDefault/Standard.ascx");
    }

------------------- USER CONTROL INSTANCE .ASPX -------------------
<uc:MyControl ID="MyControl1" runat="server" >
    <ItemTemplate>
            ...unique template...
    </ItemTemplate>
</uc:MyControl>

Thanks,
Jeremy

Iana Tsolova
Telerik team
 answered on 08 Feb 2011
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?