Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
113 views
Hi there
I created a custom skin for my RadGrid, but the Filter Items are not displaying correctly, they are too big.

I have tried setting almost every available option of the rgFilterRow height, I have set the FilterItemStyle and even created a code behind section

GridFilteringItem filteringItem = e.Item as GridFilteringItem;
            //set dimensions for the filter textbox 
            filteringItem["Date"].Width = Unit.Pixel(120);
            TextBox box = filteringItem["Status"].Controls[0] as TextBox;
            box.Height = Unit.Pixel(22);

All the other CSS works fine, but I can't get this to work and its driving me crazy :)

Here is a section of the css
.RadGrid_CustomGrid .rgFilterRow
{
    background:#eee;
    height:22px;
}
 
.RadGrid_CustomGrid .rgFilterRow input
{
    height:22px;
}
 
.RadGrid_CustomGrid .rgFilterRow td
{
    border-bottom:1px solid #828282;
    height:22px;
}
 
.RadGrid_CustomGrid .rgFilter
{
    background-position:0 -300px;
    height:22px;
}
 
.RadGrid_CustomGrid .rgFilter:hover
{
    background-position:0 -350px;
}
 
.RadGrid_CustomGrid .rgFilterActive,
.RadGrid_CustomGrid .rgFilterActive:hover
{
    background-position:0 -400px;
}
 
.RadGrid_CustomGrid .rgFilterBox
{
    border-color:#8e8e8e #c9c9c9 #c9c9c9 #8e8e8e;
    font-family:Arial, Helvetica, sans-serif;
    color:#333;
}

Jako
Top achievements
Rank 1
 answered on 05 Jul 2012
2 answers
100 views
I have run into, what appears to be, a bug in RadPanelBar. The problem is as follows.

I have the following layout:
->Parent 1
-> Child 1
-> Grandchild 1
-> Grandchild 2
-> Child 2
-> Grandchild 1
-> Grandchild 2

I set "Child 2 -> Grandchild 2" to invisible (VIsible = false) on every post back. Everything works fine, until I click on "Child 2 -> Grandchild 1" or "Child 2 -> Grandchild 2". 
. After I click on that link, "Child 1 -> Grandchild 2" also becomes hidden.

To reproduce the problem, launch the application (1), Expand "Child 2" and click on "Grandchild 1". Now expand "Child 1" (2). "Grandchild 2" under "Child 1" is invisible now, even though it should be visible.

(1)
->Parent 1
-> Child 1
-> Grandchild 1
-> Grandchild 2
-> Child 2
-> Grandchild 1   <- CLICK
(2)
->Parent 1
-> Child 1
-> Grandchild 1
-> Child 2
-> Grandchild 1 


Site.Master.cs:
http://pastebin.com/NLFVY6C6 
SIte.Master
http://pastebin.com/1jYD7Uz9 
Default.aspx.cs
http://pastebin.com/TPtBu35n 
Default.aspx
http://pastebin.com/4tqATYyi
Web.config
http://pastebin.com/fKKZwbkD 

Thank you for any help,
Andrey
Andrey
Top achievements
Rank 1
 answered on 05 Jul 2012
1 answer
360 views
I don't want to save a physical file anywhere.  The user needs to upload a CSV file and then I want to read it directly in memory and do things based off what I find in that file.

I found a sample on this site saying you could use the "InputStream" property to read in the file, but the example showed a simple table with "file name", "file size", and one big blob column for "file contents", which is not really reading the file itself.  I need to get the contents of the file into a string and then break that apart by commas and process accordingly.

Is there a way for me to take the uploaded file bytes and turn them into a string that contains the exact data the CSV file contains, or is a byte array the best I can do without writing the file to disk?
Kevin
Top achievements
Rank 1
 answered on 05 Jul 2012
0 answers
171 views
protected void gvgrid_CustomAggregate(object sender, GridCustomAggregateEventArgs e)
    {
        if (((Telerik.Web.UI.GridBoundColumn)e.Column).UniqueName == "Actual")
        {
 
            Double intNrvalue = 0;
            Double intDrvalue = 0;
             
 
            foreach (GridDataItem item in gvgrid.MasterTableView.Items)
            {
                
                    intNrvalue += Convert.ToDouble(item["intNumeratorvalue"].Text);
                    intDrvalue += Convert.ToDouble(item["intDenominatorvalue"].Text);
  
            }
 
            double intResult=(intNrvalue / intDrvalue)*100;
            e.Result = intResult;
             
        }
    }
I have a grid that  needs to have a custom aggregate function (for a Grid Bound Column having Aggregate="Custom") such that it need to calculate the Actual by calculating the sum(numerators) / sum(denominators).
Now if we group that grid by dragging one column in the group panel then it should show calculation at the group level(means at group footer). Any help or samples would be appreciated.
E.g. The same functionality is provided for Aggregate="Sum" for a grid bound column by default.When we drag a particular column in a group panel,then it calculates sum at group level in group footer and overall sum at grid footer.
Anuj
Top achievements
Rank 1
 asked on 05 Jul 2012
2 answers
503 views
Hi All

can anyone give me a solution to get the values binded to radgrid and made the column as hidden/visible =false

i need to get the hiddden values of the rows where checkboxes are checked, if header checkox is checked i need to get all values and use those values...

this is my radgrid

            <telerik:RadGrid ID="M" runat="server" Width="99%" AllowPaging="True" EnableViewState="False"
                GridLines="None" meta:resourcekey="MResource1" AllowFilteringByColumn="true"
                OnInit="GridControl_Init" EnableLinqExpressions="false" 
                EnableEmbeddedSkins="false" AutoGenerateColumns="False">
                <HeaderContextMenu EnableEmbeddedSkins="True">
                </HeaderContextMenu>
                <FilterMenu Skin="Nediso" EnableEmbeddedSkins="false">
                </FilterMenu>
                <PagerStyle Mode="NextPrevAndNumeric" Position="TopAndBottom" AlwaysVisible="true" />
                <MasterTableView Width="100%" EnableViewState="False" AllowFilteringByColumn="true">
                   <Columns>  


                   <telerik:GridTemplateColumn UniqueName="CheckBoxTemplateColumn" AllowFiltering="false">
                   <HeaderStyle Width="3%" HorizontalAlign="Justify" />
                    <ItemStyle Width="3%" HorizontalAlign="Justify" />
                            <HeaderTemplate>
                             <asp:CheckBox id="headerChkbox"  runat="server" onclick="SelectAll(this)"></asp:CheckBox>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:CheckBox id="CheckBox1" runat="server"></asp:CheckBox>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                   
                     <telerik:GridBoundColumn DataField="TOKEN" Visible="false" UniqueName="TOKEN" >
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="FIRST NAME" HeaderText="FIRST NAME" UniqueName="FIRST NAME1">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="LAST NAME" HeaderText="LAST NAME" UniqueName="LAST NAME1">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="STATUS" HeaderText="STATUS" UniqueName="STATUS1">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="DESIGNATION" HeaderText="DESIGNATION" UniqueName="DESIGNATION1">
                    </telerik:GridBoundColumn>
                    </Columns>
                    <PagerStyle AlwaysVisible="true" Mode="NextPrevAndNumeric" Position="TopAndBottom" />
                    
                </MasterTableView>
                <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True" EnableRowHoverStyle="True">
                    <Resizing AllowColumnResize="True" />
                    <Selecting AllowRowSelect="True" />                    
                    <ClientEvents OnFilterMenuShowing="OnFilterMenuShowing"></ClientEvents> 
                    </ClientSettings>
                <FilterMenu EnableTheming="True">
                    <CollapseAnimation Type="None" />
                    <ExpandAnimation Type="None" />
                </FilterMenu>
            </telerik:RadGrid>

i have a button outside the grid when the button is clicked i need to get the value placed in hidden column for only which the textbox is checked..  pls reply me soon.
Jayesh Goyani
Top achievements
Rank 2
 answered on 05 Jul 2012
3 answers
487 views
Hi,

I have rad grid in my application. In that I have export buttons (export to pdf / word / excel). My issue is how to disable the button if there is no data inside the grid. Now, if there is no data in grid, if click on the export buttons empty file is creating. To avoid this, I need to disable export buttons if there is no data in grid. Thanks in Advance.

Regards,
Akki
Jayesh Goyani
Top achievements
Rank 2
 answered on 05 Jul 2012
1 answer
99 views
I have a RadGrid that I'm supplying a data source in code-behind, and trying to use InPlace editing.  I'm able to put the row in to the Edit view, enter new values, and click update, but the users new information is never saved:

<telerik:RadGrid ID="radGrdDetails" runat="server"  EnableLinqExpressions="false"
                    AllowPaging="False" AllowSorting="True" GridLines="None" Skin="<%$ AppSettings: YALSkin%>"
                     AllowAutomaticInserts="False" AllowAutomaticUpdates="false" AllowMultiRowEdit="false" showstatusbar="true"  Width="800" AllowFilteringByColumn="true" AutoGenerateColumns="false" AutoGenerateEditColumn="false">
                                                              
                            <MasterTableView CommandItemDisplay="Top"   DataKeyNames="ID" EditMode="InPlace">
                                                               <Columns>
                                    <telerik:GridEditCommandColumn />                                                              
                                    <telerik:GridBoundColumn UniqueName="ID" ReadOnly="true" Visible="false"   DataField="ID"></telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn UniqueName="NUMBER" ReadOnly="true" DataField="NUMBER" HeaderText="Number" SortExpression="NUMBER"></telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn UniqueName="TYPE" ReadOnly="true" DataField="TYPE" HeaderText="Type" SortExpression="TYPE"></telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn UniqueName="COUNTY" DataField="COUNTY" HeaderText="County" SortExpression="COUNTY"></telerik:GridBoundColumn>
                                                                   </Columns>                                  
 
 
                                <RowIndicatorColumn>
                                    <HeaderStyle Width="20px" />
                                </RowIndicatorColumn>
                                <ExpandCollapseColumn>
                                    <HeaderStyle Width="20px" />
                                </ExpandCollapseColumn>
                             
                            </MasterTableView>
                         
                </telerik:RadGrid>

the binding is done in Page.Load

I'm trying to build a Hashtabe containing what the user has changed.  Here is the grid's update command:

Protected Sub radGrdDetails_UpdateCommand(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles radGrdDetails.UpdateCommand
       Dim oldValues, newValues, changedValues As Hashtable
       newValues = New Hashtable
       changedValues = New Hashtable
 
       Dim editedItem As GridEditableItem = CType(e.Item, GridEditableItem)
 
       oldValues = editedItem.SavedOldValues
 
       editedItem.ExtractValues(newValues)
 
       For Each key As String In oldValues.Keys
           If oldValues(key) = newValues(key) Then
               'field has not changed, don't edit
           Else
               'field has changed
               changedValues.Add(key, newValues(key))
           End If
       Next
 
   End Sub


However, oldValues and newValues are always exactly the same -- ie, what the user puts in isn't being saved.
Jayesh Goyani
Top achievements
Rank 2
 answered on 05 Jul 2012
0 answers
84 views
HI,

I have a bug in all my grid on my web site on IIS 7.

I think it's a simple web.config problem but I can't find what it is.

Do you have any idea?

Thanks!!
Vincent
Top achievements
Rank 1
 asked on 05 Jul 2012
2 answers
155 views
So here is what I am trying to achieve.  I have multiple radgrids on a single page in a tabbed view.  Some of these radgrids implement the same user control.  However they pull different data.  I have public properties set in the usercontrol that reference the input fields (RadTextBox, RadComboBox, Checkbox, etc.).  When I implement the user control driectly on the page without binding it to a radgrid everything works properly.  I can do:
RadTextBox item1 = userControl1.Item1TextBox;
InsertItem(item1.Text);
where InsertItem is a method that inserts the item text into the database

However on the page with the radgrids the way the user control is bound is
protected override void OnInit(EventArgs e)
{
   base.OnInit(e)
        RadGrid1.Skin = Skin;
        RadGrid1.Width = GridWidth;
        RadGrid1.AutoGenerateColumns = false;
        RadGrid1.NeedDataSource += RadGrid1_NeedDataSource;
        RadGrid1.NeedDataSource += RadGrid1_InsertCommand;
        RadGrid1.NeedDataSource += RadGrid1_UpdateCommand;
        RadGrid1.NeedDataSource += RadGrid1_DeleteCommand;
        RadGrid1.MasterTableView.Width = Unit.Percentage(100);
        RadGrid1.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.Top;
        RadGrid1.MasterTableView.CommandItemSettings.ShowAddNewRecordButton = true;
        RadGrid1.MasterTableView.CommandItemSettings.ShowRefreshButton = false;
        RadGrid1.MasterTableView.ShowHeadersWhenNoRecords = true;
        RadGrid1.MasterTableView.EditFormSettings.UserControlName = "/includes/userControls/RoofForm.ascx";
        RadGrid1.MasterTableView.EditFormSettings.EditFormType = GridEditFormType.WebUserControl;
        RadGrid1.MasterTableView.DataKeyNames = DataKeys;
}
with the main point being:

RadGrid1.MasterTableView.EditFormSettings.UserControlName = "/includes/userControls/RoofForm.ascx";
RadGrid1.MasterTableView.EditFormSettings.EditFormType = GridEditFormType.WebUserControl;

So my question is:  Is it possible to access these public properties which return a control in the InsertCommand/UpdateCommand bindings or am I forced to use the FindControl?

For example:
protected void RadGrid1_InsertCommand(object sender, GridCommandEventArgs e)
{
    UserControl userControlForm= e.Item.FindControl(GridEditFormItem.EditFormUserControlID) as UserControl;
 
    RadComboBox item1 = userControlForm.Property1;
    RadComboBox item2 = userControlForm.Property2;
    RadComboBox item3 = userControlForm.Property3;
    RadComboBox item4 = userControlForm.Property4;
    RadComboBox item5 = userControlForm.Property5;
    RadDatePicker item6 = userControlForm.Property6;
    RadNumericTextBox item7 = userControlForm.Property7;
    RadNumericTextBox item8 = userControlForm.Property8;
 
        if (insert(item1.text, item2.text, item3.text, item4.text, etc..)
        {
            ErrorMessages.Text += "<br />The  item was saved but there were other errors";
        }
        else
        {
            AllSaved = false;
            ErrorMessages.Text += "<br />The item was not saved.  Please go to the parent entry to add the item.";
        }
}


If this isn't clear let me know and I will be happy to elaborate.
Kevin
Top achievements
Rank 1
 answered on 05 Jul 2012
1 answer
102 views
Hi 

Below is wire frame of my asp.net page.

Rad Splitter
--------------------------------------------------------------------------------
| |     |
| |     | 
| |     | 
| Left pane | Right pane     | 
| |     | 
| |     | 
| |     | 
-------------------------------------------------------------------------------- 


Contents in left pane details:-
In it I am having one radtoolbar 
On clicking any buttons radtoolbar , I am using content URL properties set_contentURL of rightPane.

Scenarios:-
When first time page gets opened in rightPane it is not having "O" querystring parameter.
 But when use navigates(redirects to another page right Pane) further in page opened in rightPane  "O" querystring parameter will come with some value (let's say O=1). When user navigates to another page again then O will get changed to any other number.

What I want?
I need to store O=1 in hiddenField in aspx page.

Initially I was using iFrame inside rightPane and I was able to achieve it by using iFrame's client side onLoad evnet.

But as per telerik help rightPane  becomes iFrame automatically  by using set_contentUrl property of rightPane from leftPane links.

Problem:-

I am not able to find clientside load event for rightPane.

Please help me to proceed further ASAP.







Dobromir
Telerik team
 answered on 05 Jul 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?