Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
96 views
Hi,
My requirement : To display the hierarchial items in Radgrid.
Instead of using Nestedview template,  thought of using iframe for each grid row.
For example :
===========
Parent record 
    |
    | -->iframe page with child grid
                |
                |--> iframe page with grand child grid

====================================

For this, my code has single radgrid with one GridTemplateColumn column
Inside that  GridTemplateColumn 
    - created Header template -inside that, table for column headers
    - created item template - inside that table for column values
In the first column in the table will be image column, if click on the img, it will open the iframe page and based in the query string am binding the child grid records.


My issue is, i want sorting, filtering for each column inside the header template.

Because of one template column, default filtering option will be one textbox appearing in the grid.


my code is:

   <telerik:RadGrid ID="grdparent" runat="server" Width="600px" AutoGenerateColumns="false"
            OnNeedDataSource="Needdatasource" ItemStyle-Height="25px" AlternatingItemStyle-Height="25px"
            SelectedItemStyle-Height="25px" BorderColor="#009933" BorderWidth="1px" GroupingEnabled="false"
            AllowSorting="True" AllowMultiRowSelection="False" AllowFilteringByColumn="True"
            AllowPaging="True" GridLines="None" ShowGroupPanel="false" ShowStatusBar="true"
            FilterItemStyle-BackColor="#F1F7EE" PageSize="10">
            <GroupingSettings CaseSensitive="false" />
            <MasterTableView DataKeyNames="ParentID" AllowMultiColumnSorting="false" InsertItemPageIndexAction="ShowItemOnFirstPage"
                InsertItemDisplay="Top" GroupLoadMode="Server" ShowHeadersWhenNoRecords="true"
                CommandItemDisplay="None" EditMode="PopUp" EnableHeaderContextMenu="false"
                CommandItemSettings-AddNewRecordText="Add" AllowAutomaticInserts="false"
                AllowFilteringByColumn="True" AllowSorting="true" ExpandCollapseColumn-ButtonType="ImageButton">
                <Columns>
                    <telerik:GridTemplateColumn>
                        <HeaderTemplate>
                            <table width="600px" class="mod_content" cellpadding="0" cellspacing="0" border="0">
                                <tr onclick="selectRow(this);">
                                    <td style="width: 30px">
                                    </td>
                                    <td style="width: 50px">
                                        Parent ID
                                    </td>
                                    <td style="width: 300px">
                                        Parent Name
                                    </td>
                                </tr>
                            </table>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <table width="600px" class="mod_content" cellpadding="0" cellspacing="0" border="0">
                                <tr onclick="activeRow(this);">
                                    <td style="width: 30px">
                                        <a href="#" onclick="return toggleDivDisplay('tr_<%#DataBinder.Eval(Container,"DataItem.ParentID")%>', this, false,'Child.aspx?ParentID=<%#DataBinder.Eval(Container,"DataItem.ParentID")%>' );">
                                            <img src="../images/Expand.gif" alt="Expand/Collapse" id="tr_<%#DataBinder.Eval(Container,"DataItem.ParentID")%>image"
                                                height="14" width="14" border="0" /></a>
                                    </td>
                                    <td style="width: 50px">
                                        <asp:Label ID="lblHdnParentID" runat="server" CssClass="gridlabel" Text='<%#DataBinder.Eval(Container, "DataItem.ParentID")%>'></asp:Label>
                                    </td>
                                    <td style="width: 150px">
                                        <asp:Label ID="lblParentIDName" CssClass="gridlabel" Text='<%# Eval("ParentName") %>'
                                            runat="server"></asp:Label>
                                    </td>
                                </tr>
                                <tr style="padding: 0px 0px 0px 0px">
                                    <td colspan="3" style="padding: 0px 0px 0px 0px">
                                        <div id='tr_<%#DataBinder.Eval(Container,"DataItem.ParentID")%>' class="display_false"
                                            style="padding-left: 15px">
                                            <iframe id="tr_<%#DataBinder.Eval(Container,"DataItem.ParentID")%>frame" src="Child.aspx"
                                                frameborder="0" scrolling="yes" height="150" width="100%"></iframe>
                                        </div>
                                    </td>
                                </tr>
                            </table>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>

 

Antonio Stoilkov
Telerik team
 answered on 19 Feb 2013
7 answers
250 views
Hi
I'm using RadImageEditor to edit an image. Every time when I rotate the image, it seems the image is not saved when I use imgEditor.GetEditableImage(). Any ideas?



Vessy
Telerik team
 answered on 19 Feb 2013
4 answers
758 views
Hello,
i have a question.
It is possible to enter in a gridbound column,when editing, html tags like
John<form> and take the whole sentence as it is,a literal.We need any kind of solution for our problem.


Best Regards,
Daniel

P.S:we would appreciate a response as soon as possible.
Daniel
Top achievements
Rank 1
 answered on 19 Feb 2013
3 answers
284 views

Hi I have a scenario where I am creating table inside 2 seperate grid columns. I want the tables inside both the columns to be the same size.

For ex table 1 can have 4 rows while table 2 can have 6 rows. I match up the rows in table1 and table2 and if there is no matching row I add an empty cell to that row.

I want the rows to have the same height so the rows look aligned with the data... data in table1 to data in table2 or empty row in table1 to data in table 2. or if the data in table2 wraps to two lines then the corresponding row in table1 to have the same height.
Currently, they don't align well as the rows with empty space don't take up any height.

I've tried adding row height but that doesn't help.Please suggest

below is my code:

      GridDataItem item = e.Item as GridDataItem;
       int accountID = Int32.Parse(item.GetDataKeyValue("AccountID").ToString());
       DataRow[] dr = PayoutElection.GetPayouts_ByAccount_ListByParticipant(Int32.Parse(Profile.ParticipantID), accountID, PayoutTypeFilter);
 
       Table tblPayoutType = new Table();
       Table tblPayoutDesc = new Table();
       Table tblEffectiveDate = new Table();
       foreach (DataRow row in dr)
       {
           TableRow trPayoutType = new TableRow();
           trPayoutType.Attributes.Add("class", "mergedItems");
           TableRow trPayoutDesc = new TableRow();
           trPayoutDesc.Attributes.Add("class", "mergedItems");
           TableRow trEffectiveDate = new TableRow();
           trEffectiveDate.Attributes.Add("class", "mergedItems");
 
           TableCell cellPayoutType = new TableCell();
           cellPayoutType.Text = row["PayoutType"].ToString();
 
           TableCell cellPayoutDesc = new TableCell();
           cellPayoutDesc.Text = row["PayoutDescription"].ToString();
 
           TableCell cellEffectiveDate = new TableCell();
           DateTime effDate = (DateTime)row["EffectiveDate"];
           DateTime currentDate = DateTime.Parse(Profile.CurrentDate);
           cellEffectiveDate.Text = effDate.ToString(Utility.MBFormatDate);
 
           trPayoutType.Cells.Add(cellPayoutType);
           tblPayoutDesc.Rows.Add(trPayoutDesc);
           trPayoutDesc.Cells.Add(cellPayoutDesc);
           tblPayoutType.Rows.Add(trPayoutType);
           trEffectiveDate.Cells.Add(cellEffectiveDate);
           tblEffectiveDate.Rows.Add(trEffectiveDate);
 
           if (effDate > currentDate)
           {
               if (cellPayoutType.Text == _currentPayoutType)
               {
                   cellPayoutType.Text = "";
               }
           }
     }
item["PayoutType"].Controls.Add(tblPayoutType);
item["PayoutDescription"].Controls.Add(tblPayoutDesc);
Antonio Stoilkov
Telerik team
 answered on 19 Feb 2013
3 answers
98 views
hi
i wanted to edit the values inside the grid so that i wanted to get all the entered values and update using updatecommand.

from text box i am able to get the values in updatecommand but in case of combobox i am not able to get the selectedvalue of the combobox in code behind of updatecommaond of gridview.

can any one plz post me the code to update data using combobox and checkboxes if possible..


Thanks
Santosh
Shinu
Top achievements
Rank 2
 answered on 19 Feb 2013
2 answers
60 views
Hi Guys

In the below url there are two grids with |< < 1 2 3 > >|
http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/paging/defaultcs.aspx

If i mouse over all page numbers i can see some javascript with div id  but when i mouse over right arrow or left arrow nothing is coming up
can i add some parameters to it so that in page load i can load particular i need

Karthik.K

Karthik Kantharaj
Top achievements
Rank 1
 answered on 19 Feb 2013
7 answers
310 views
Hi all,

I have a grid with the structure shown bellow. I would like to fill the SkuId Label when a selectedvalue on the radcombobox exists. I have a function to obtain the SKU data from the combo selectedValue (actually the productID from where I can obtain the SKU) when it's in edit mode. The problem is that I am not able to set the text property for the label because after an insert or an update I loose my combo selected value info.

I cannot figure how to write the SKU text in any grid condition... maybe an AJAX / independent approach would be better.

The grid allows automatic inserts and updates and the information is binded from an EF datasource. The SKU column has no bindings because it's only a visual reference for the user entering the information and should not be saved on the DB.

Thanks!
<telerik:GridBoundColumn DataField="Id" DataType="System.Int32" FilterControlAltText="Filter Id column" HeaderText="Id" ReadOnly="True" SortExpression="Id" UniqueName="Id" Visible="false"/>
                <telerik:GridBoundColumn DataField="OrderId" DataType="System.Int32" FilterControlAltText="Filter OrderId column" HeaderText="Order" SortExpression="OrderId" UniqueName="OrderId" Visible="false" ReadOnly="true" />
                 
                <telerik:GridDropDownColumn DataSourceID="SqlDSProductList" ListTextField="Name" ListValueField="Id" HeaderStyle-Width="400px"
                    UniqueName="VariantId" SortExpression="Name" HeaderText="Product" DataField="ProductVariantId"
                    DropDownControlType="RadComboBox" AllowAutomaticLoadOnDemand="true" AllowVirtualScrolling="true" ShowMoreResultsBox="true" ItemsPerRequest="25">
                </telerik:GridDropDownColumn>
 
                <telerik:GridTemplateColumn UniqueName="SKU">
                    <ItemTemplate>
                        <asp:Label runat="server" ID="SkuId" OnLoad="SKU"></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:Label runat="server" ID="SkuId" Text="" OnLoad="SKU"></asp:Label>
                    </EditItemTemplate>
                </telerik:GridTemplateColumn>
Marc
Top achievements
Rank 1
 answered on 19 Feb 2013
4 answers
310 views
Hi

I have the following markup defining an autocomplete box and the event handler function.
The autocompletebox works fine - that it displays the suggestions as I type and I can select / remove entries.
Unfortunately when I change the autocomplete selection (add or remove selected entries) the OnEntryAdded / OnEntryRemoved are not being fired. Any idea what I might be missing?

I might be missing something very basic here... but I just don't see it.
Any help will be most appreciated.

Thanks

<telerik:RadAutoCompleteBox
   ID="OperatorAutoCompleteBox"
  runat="server"
  DropDownHeight="150"
  EmptyMessage="(Select Operator)"
  DataSourceID="sqlOperatorsLookupList"
  DataTextField="Full_Name"
  DataValueField="Operator_ID"
  Filter="Contains"
  InputType="Text"
  OnEntryAdded="OperatorAutoCompleteBox_SelectedOperatorChanged"
  OnEntryRemoved="OperatorAutoCompleteBox_SelectedOperatorChanged"
  AutoPostBack="true">
 
 </telerik:RadAutoCompleteBox>

  Protected Sub OperatorAutoCompleteBox_SelectedOperatorChanged(sender As Object, e As AutoCompleteEntryEventArgs)
    do something here...
  End Sub
Mark Kucera
Top achievements
Rank 1
 answered on 18 Feb 2013
2 answers
116 views
Hello,

I've tried to use this example Simple Databinding in a project, but I have run in to a  problem because my case differs a bit from the example code..

On the Website i have 3 Textfileds (Searchfield, Searchcriterium,SearchValue), a SerchButton and a ReloadButton.
When the User collect his Search and press the SearchButton , i generate the SQL-String and get the Data with a SQLDataSource.

My problems are when the Site starts at first witout a search, i get exceptions ( no search = no data)  and witch Method is correct
and how i do this to bind and  get a result with the RadGrid? Its my first project with the ASP.NET and the RadControls.

Best Regards
Uwe


Uwe
Top achievements
Rank 1
 answered on 18 Feb 2013
3 answers
72 views
Dear,

An user of our mailing application have found a bug in the editor.
I've reproduced this bug in our version of the editor and in the latest version on your demo examples.
This bug will only happens in the browser Chrome.

I'll explain the bug:
In Chrome we can request image properties from right mouse button and all fields are filled correctly.
When we set the alignment of the image to left, the editor will add style="float: left;" to the image.
After set the alignment we can't request image properties anymore.

For you to reproduce this bug:
Place an image in an empty editor.
Type some text beside the image and set the alignment of the image to left.
Request the image properties from right mouse button.

How to fix?

Kind regards,

Jelle de Boer
EM-Cultuur

NB: See for example below, this html will fail in the editor (Chrome)

<img alt="" src="http://mailinglijst.eu/klanten/11714/import/dorine%20wiersma.jpg" style="float: left;" />
Je kunt er mee naar musicals, naar Claudia de Breij, maar wat het allerleukste is, je kunt ermee naar mij'…zingt Dorine Wiersma in de nieuwe commercial van de PODIUM cadeaukaart.<br />
<br />
Wiersma, die voor het lied de Annie M.G. Schmidtprijs voor het beste theaterlied ontving, gebruikt de commercial van de PODIUM cadeaukaart om haar nieuwe theatershow eens even goed onder de aandacht te brengen!

Rumen
Telerik team
 answered on 18 Feb 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?