Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
72 views
I have a radgrid (rg1) that has a custom edit form. In the custom edit form for rg1, I have another radgrid(rg2). In rg2 I need to use another custom edit form and this is where the issue begins. In order to get rg2 the data it needs to populate I had to use a button since the data did not exist until after the form is loaded, if there is a better way please share as the button does not feel like a good solution. So once I press the button rg2 now has data and is displayed. When I press the "add new record" button in rg2 I want it to show my custom edit form like it does in rg1. What it is does however is clears the data from rg2. Now if I click the button used to show rg2 in the first place it now opens but not with the data but the edit form instead. So how do I make rg2 show the custom edit form without resetting rg2 and having to press the button again to see it? code for both below:


rg1:

<telerik:RadGrid ID="contactsGrid" runat="server" OnNeedDataSource="contactsGrid_NeedDataSource"
                AllowSorting="False" AllowFilteringByColumn="true"  Skin="Default" GridLines="Both" AutoGenerateColumns="False"
                ShowFooter="false" AllowPaging="true" PageSize="25" PagerStyle-AlwaysVisible="true"
                OnUpdateCommand="contactsGrid_UpdateCommand" OnInsertCommand="contactsGrid_InsertCommand"
                EnableLinqExpressions="false" OnDeleteCommand="contactsGrid_DeleteCommand" GroupingEnabled="True" ShowGroupPanel="True"
                GroupPanel-Enabled="True">
                <ClientSettings AllowDragToGroup="True"/>
                <PagerStyle Mode="NextPrevNumericAndAdvanced" Position="TopAndBottom" HorizontalAlign="Center" />
                <MasterTableView AllowMultiColumnSorting="true" CommandItemDisplay="Top" CommandItemSettings-ShowRefreshButton="False" DataKeyNames="contact_id"
                    NoMasterRecordsText="No current contacts." TableLayout="Fixed">
                    <RowIndicatorColumn Visible="False">
                        <HeaderStyle Width="20px"></HeaderStyle>
                    </RowIndicatorColumn>
                    <Columns>
                        <telerik:GridEditCommandColumn UniqueName="btnEdit" ButtonType="ImageButton" Resizable="False" >
                            <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" />
                            <HeaderStyle Width="50px" />
                        </telerik:GridEditCommandColumn>
                        <telerik:GridBoundColumn DataField="contact_id" HeaderText="CONTACT_ID" UniqueName="CONTACT_ID"
                            AllowFiltering="True" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" >
                            <HeaderStyle Width="100px" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="CONTACT_ORG" HeaderText="CONTACT_ORG" UniqueName="CONTACT_ORG"
                            AllowFiltering="true" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" Groupable="True" >
                            <HeaderStyle Width="160px" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="LOCATION_NAME" HeaderText="LOCATION_NAME" UniqueName="LOCATION_NAME"
                            AllowFiltering="true" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" Groupable="True" >
                            <HeaderStyle Width="160px" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="CONTACT_NAME" HeaderText="CONTACT_NAME" UniqueName="CONTACT_NAME"
                            AllowFiltering="true" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" Groupable="True" >
                            <HeaderStyle Width="160px" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="PHONE" UniqueName="PHONE" HeaderText="PHONE"
                            AllowFiltering="true" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" Groupable="True" >
                            <HeaderStyle Width="150px" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="ALT_PHONE" HeaderText="ALT_PHONE" UniqueName="ALT_PHONE"
                            AllowFiltering="true" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" Groupable="True" >
                            <HeaderStyle Width="150px" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="CELL" HeaderText="CELL" UniqueName="CELL" AllowFiltering="true"
                        AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" Groupable="True" >
                            <HeaderStyle Width="150px" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="FAX" UniqueName="FAX" HeaderText="FAX" AllowFiltering="true"
                        AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" Groupable="True" >
                            <HeaderStyle Width="150px" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="DSN" HeaderText="DSN" UniqueName="DSN" AllowFiltering="true"
                        AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" Groupable="True" >
                            <HeaderStyle Width="100px" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="EMAIL" HeaderText="EMAIL" UniqueName="EMAIL"
                            AllowFiltering="true" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" Groupable="True" >
                            <HeaderStyle Width="200px" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="COMMENTS" HeaderText="COMMENTS" UniqueName="COMMENTS"
                            AllowFiltering="true" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" Groupable="True" >
                            <HeaderStyle Width="160px" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="CONTACT_SRV" HeaderText="CONTACT_SRV" UniqueName="CONTACT_SRV"
                            AllowFiltering="true" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" Groupable="True" >
                            <HeaderStyle Width="100px" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="GROUP_ID" HeaderText="GROUP ID" UniqueName="GROUP_ID"
                            AllowFiltering="true" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" Groupable="True" >
                            <HeaderStyle Width="160px" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="GROUP_NAME" HeaderText="GROUPS" UniqueName="GROUP_NAME"
                            AllowFiltering="true" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" Groupable="True" >
                            <HeaderStyle Width="160px" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="LAST_UPDATED" HeaderText="LAST_UPDATED" UniqueName="LAST_UPDATED"
                            DataType="System.DateTime" AllowFiltering="false" DataFormatString="{0:MM/dd/yyyy}" Groupable="True" >
                            <HeaderStyle Width="100px" />
                        </telerik:GridBoundColumn>
                        <telerik:GridButtonColumn ConfirmText="Delete this contact?" ConfirmDialogType="RadWindow"
                            ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete"
                            UniqueName="DeleteColumnContacts" Visible="true">
                            <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" />
                            <HeaderStyle Width="50px" />
                        </telerik:GridButtonColumn>
                    </Columns>
                    <EditFormSettings UserControlName="EditContact.ascx" EditFormType="WebUserControl">
                        <EditColumn UniqueName="EditCommandColumn1" >
                        </EditColumn>
                    </EditFormSettings>
                </MasterTableView>
                <EditItemStyle CssClass="EditFormHeader"></EditItemStyle>
                <ValidationSettings CommandsToValidate="PerformInsert, Update" />
            </telerik:RadGrid>


rg2:

<td>
                                    <asp:Button Visible='<%# !(DataItem is GridInsertionObject) %>' ID="editGroups" runat="server"
                                        Text="Edit Groups" OnClick="GroupMember" />
                                    <telerik:RadGrid Visible='<%# !(DataItem is GridInsertionObject) %>' ID="groupMemberGrid"
                                        runat="server" AllowSorting="False" AllowFilteringByColumn="false" Skin="Default"
                                        GridLines="Both" AutoGenerateColumns="False" ShowFooter="false" EnableLinqExpressions="false"
                                        OnDeleteCommand="groupMemberGrid_DeleteCommand">
                                        <GroupingSettings CaseSensitive="false" />
                                        <MasterTableView AllowMultiColumnSorting="false" CommandItemDisplay="Top" DataKeyNames="group_id"
                                            NoMasterRecordsText="Not a member of any groups." TableLayout="Fixed">
                                            <RowIndicatorColumn Visible="False">
                                                <HeaderStyle Width="20px"></HeaderStyle>
                                            </RowIndicatorColumn>
                                            <Columns>
                                                <telerik:GridButtonColumn ConfirmText="Delete this group?" ConfirmDialogType="RadWindow"
                                                    ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete"
                                                    UniqueName="DeleteGroup" Visible="true">
                                                    <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" />
                                                    <HeaderStyle Width="50px" />
                                                </telerik:GridButtonColumn>
                                                <telerik:GridBoundColumn DataField="GROUP_ID" HeaderText="Group ID" UniqueName="GROUP_ID"
                                                    AllowFiltering="True">
                                                    <HeaderStyle Width="100px" />
                                                </telerik:GridBoundColumn>
                                                <telerik:GridBoundColumn DataField="GROUP_NAME" HeaderText="Group Name" UniqueName="GROUP_NAME"
                                                    AllowFiltering="false">
                                                    <HeaderStyle Width="160px" />
                                                </telerik:GridBoundColumn>
                                            </Columns>
                                            <EditFormSettings UserControlName="AddToGroup.ascx" EditFormType="WebUserControl">
                                                <EditColumn UniqueName="EditCommandColumn2">
                                                </EditColumn>
                                            </EditFormSettings>
                                        </MasterTableView>
                                        <EditItemStyle CssClass="EditFormHeader"></EditItemStyle>
                                        <ValidationSettings CommandsToValidate="Delete" />
                                    </telerik:RadGrid>
                                </td>
Angel Petrov
Telerik team
 answered on 08 Apr 2013
1 answer
118 views
Hello,

When I click insert drag drop document image on my page I am getting a strange exception. Pop-up is coming up with a test as "the command insert dragdrop document is not implemented yet."

I have two save buttons on my page one is of master and other is of child form. First time when I drag drop anything and click on master page's save button it does get save and after that when I again click on insert drag drop then it gives aforementioned message in a pop-up. Otherwise it never gives any problem.

Has anybody ever encountered this?

If yes please provide help.

Thanks,
Dheeraj.
Hristo Valyavicharski
Telerik team
 answered on 08 Apr 2013
3 answers
91 views
Hi,
we are using 2013 Q1 Radgrid.

I came to know that Radgrid doesn't have clientside sorting unless it is done through webservice call etc. Only other option is to enable sorting on server side. In sort command event, help link suggest to rebind the grid. My situation is like this:

I bind the grid in page load event when it is not a postback like this:

protected

 

void Page_Load(....)

 

 

    if (!IsPostBack)

 

    {

 

        //bind radgrid
        bindgrid(txtbox1.text, dropdownlist1.selectedvalue);
     }
}

private void bindgrid(string txtvalue, string ddlvalue)
{
      radgrid1.DataSource = customobject;   //data retrieved as custom object from databased using those parameters
      radgrid1.DataBind();
}

Based on certain conditions some columns are shown/hide in ItemDataBound event. On the page, there are many other controls along with Radgrid. User can select different choices of these controls (like different data, different list item from dropdown etc) and click on another button called refresh. In this button click event we are binding grid again with different parameter values.

We have a button called 'ShowStatus'. When this button is clicked, status column (which is hidden initially) should be shown. we loop thru all the rows and get key values (as xml) and send to database and get back status for each item as xml. Then again we loop thru rows and assign status to each row status cell.
This is working fine and when 'ShowStatus' button is clicked, status column is showing up with data.

 

protected

 

void btnShowStatus_Click(object sender, EventArgs e)

    // setting status column to be displayed
    // loop thru grid items and set status column to appropriate status coming from database as xml.

 

}

The problem is after this, if user clicks on one of the columns to sort, I am not sure what to do in sort command event. According to help, I need to bind the grid again. If I call bindgrid routine, I lose how it was before. I need the grid to display as it was before (before postback) with sorted data. How can I restore grid.


I appreciate your response.
Thanks,
Prathiba.

Kostadin
Telerik team
 answered on 08 Apr 2013
3 answers
277 views
Hi,

I have a RadGrid with a nested GridTableView (detail table). In my detail table I've specified a RadComboBox as one of the columns like this:

<telerik:ComboBox ID="tcbCompanyType" runat="server" DataTextField="Text" DataValueField="Value"
    EmptyMessage="Company type" MarkFirstMatch="True" AutoPostBack="True"
    CausesValidation="false" onselectedindexchanged="tcbCompanyType_SelectedIndexChanged" />


As expected, on changing the selection, the appropriate method is called; but I need this method to show/hide other columns in the same detail table - my other columns are all of type <telerik:GridBoundColumn>. The columns to be shown/hidden all have unique names defined for them but no IDs.

Thanks for looking :)

Eyup
Telerik team
 answered on 08 Apr 2013
1 answer
108 views
I ran into a problem where i am using a RadListView and I set the GroupItemCount programmatically depending on the size of the dataset. It seems that the property isn't persisted across a post-back and is reset to default value after page is submitted. Is this behavior by design?

Thank you.
Andrey
Telerik team
 answered on 08 Apr 2013
2 answers
81 views
Hi friends,

I want my grid to use Skin="Transparent" but my popup edit form's window to use  Skin="Glow".

how can I achieve this ? thanks...
aykut
Top achievements
Rank 1
 answered on 08 Apr 2013
5 answers
131 views
Hello,

I am using Radgrid. I have dynamically added columns in this grid like mentioned below. I wanted to add filter for some of the columns. What is the way to enable this so that some columns will have filter. I am using custom paging so how to make filter on complete records instead of current page records? Also there is column for phone where records are displayed as (123)-456-1234. If user enters 12345.. then also it should search the phone.      
GridBoundColumn boundColumn1 = new GridBoundColumn();
RadGrid1.MasterTableView.Columns.Add(boundColumn1);
boundColumn1.ItemStyle.Wrap = false;
boundColumn1.DataField = DataField;
boundColumn1.SortExpression = DataField;
boundColumn1.HeaderText = HeaderText;

Eyup
Telerik team
 answered on 08 Apr 2013
3 answers
106 views
Hello,

I have created usercontrol with radcombobox for multiple use, I have given windosxp skin to radcombobox.
Now I have used this usercontrol in radgrid in EDITFORM Template at top tr to select employee.


my problem is that when I open editform in popup, Skin of radcombo get disappear
I have found in firebug that it renders two css at time "Radcimbobox Radcimbobox_WindosXp"  

so please suggest me any solution .

Thanks
Amit
Galin
Telerik team
 answered on 08 Apr 2013
1 answer
85 views
Currently I'm displaying the filters for each column. The users want to show/hide the filters. What's the easiest way to allow the user to show/hide these column filters?
Kostadin
Telerik team
 answered on 08 Apr 2013
6 answers
103 views
Hi

I have a RADCombo Box updating another RADCombo on selected changed event. This is done with the RadAjaxManager.

It works for the first selection, but I'm not able to make any selection in the first Radcombo box following the first one.

I have both combo boxes in a RadPanelBar Panel item content template.

Any ideas?

In addition the expand behaviour of the RadPanelBar is also broken following the AJAX roundtrip.

Andy
Kate
Telerik team
 answered on 08 Apr 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?