Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
147 views
Hi
I am using Telerik radgrid with user defined columns to have custom filter controls.
 I have specified the headerstyle-width to a default column width and allowed some columns to be resizable. When the user resizes the grid and hits on sort or does any postback the column widths are not being retained.
I then went for the GridSettingsPersister class and called the persist method to save to session as shown in the demo after the column is resized. When i firebug the window the colgroup has the col width that the user resized but unfortunately this is not being picked up in the
GridSettingsPersister.GetColumnSettings. The value that is being picked up is the default headerstyle-width that I had given.
Is this because I am using user defined columns?


Any help would be appreciated as i seem to be stuck at dead ends whatever i try.
Veli
Telerik team
 answered on 24 Feb 2011
1 answer
88 views
Hi,
I used the solution in this thread to hide/display columns clientside. It works fine but the headertext gets unwrapped and gets displayed in a single line when the column is displayed after being hidden.

Is there anyway to avoid this?

Thank you!
Veli
Telerik team
 answered on 24 Feb 2011
1 answer
67 views
I'm unable to get a chart to render in a web part under SharePoint 2010. I've read all of the other posts about this and inserted the handler strings into web.config. We are not using URL rewriting. Does Telerik have an actual working example of this scenario (chart in custom web part) that I can download to use as a test?

We have Radcontrols for ASP.Net Ajax Q2 2010, SharePoint 2010 Enterprise and Windows Server 2008 R2
Bartholomeo Rocca
Top achievements
Rank 1
 answered on 24 Feb 2011
2 answers
116 views
Hi,

I am trying to create a calculated column, which I have succeeded in doing, but filtering and grouping is triggering a javascript exception.

This is my code:

<telerik:RadGrid ID="timesheetGrid" runat="server" GridLines="None" Skin="Windows7"AllowSorting="True" ShowGroupPanel="True" AutoGenerateColumns="False" AllowPaging="True"
    PageSize="15" ShowStatusBar="True" AllowFilteringByColumn="True" AllowMultiRowSelection="True"
    OnNeedDataSource="timesheetGrid_NeedDataSource" OnPreRender="timesheetGrid_PreRender"
    ViewStateMode="Enabled" onitemdatabound="timesheetGrid_ItemDataBound" Width="970px">
    <ClientSettings EnableRowHoverStyle="true" AllowColumnsReorder="True" ReorderColumnsOnClient="True"
        AllowDragToGroup="True">
        <Selecting AllowRowSelect="True" />
        <ClientEvents OnRowDblClick="RowDblClick" />
    </ClientSettings>
    <MasterTableView DataKeyNames="ID" EditMode="EditForms">
        <RowIndicatorColumn>
            <HeaderStyle Width="20px"></HeaderStyle>
        </RowIndicatorColumn>
        <ExpandCollapseColumn>
            <HeaderStyle Width="20px"></HeaderStyle>
        </ExpandCollapseColumn>
        <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
        <Columns>
            <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn" />
            <telerik:GridBoundColumn DataField="ID" HeaderText="ID" UniqueName="ID" Visible="False"
                ReadOnly="true">
            </telerik:GridBoundColumn>
            <telerik:GridDateTimeColumn DataField="From" DataType="System.DateTime"
                HeaderText="Date" UniqueName="DateFrom" ReadOnly="true" DataFormatString="{0:dd/MM/yyyy}" FilterControlWidth="100px" HeaderStyle-Width="100px">
            </telerik:GridDateTimeColumn>
            <telerik:GridBoundColumn DataField="User.UserName" HeaderText="User" UniqueName="User"
                ReadOnly="true">
            </telerik:GridBoundColumn>
            <telerik:GridNumericColumn UniqueName="Duration" HeaderText="Duration" DataType="System.Double" HeaderStyle-Width="30px" FilterControlWidth="30px">
                <ItemStyle HorizontalAlign="Right"/>
            </telerik:GridNumericColumn>
            <telerik:GridBoundColumn DataField="Description" HeaderText="Description" UniqueName="Description">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="DocketNo" HeaderText="Docket No" UniqueName="DocketNo"
                ReadOnly="true">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="FileCode" HeaderText="File Code" UniqueName="FileCode" HeaderStyle-Width="50px" FilterControlWidth="50px">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="FileCodeID" HeaderText="File Code ID" UniqueName="FileCodeID"
                Visible="false">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="CostCenter" HeaderText="Cost Center" UniqueName="CostCenter" HeaderStyle-Width="50px" FilterControlWidth="50px">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="CostCenterID" HeaderText="Cost Center ID" UniqueName="CostCenterID"
                Visible="false">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="CompanyID" HeaderText="Company ID" UniqueName="CompanyID"
                Visible="false">
            </telerik:GridBoundColumn>
            <telerik:GridCheckBoxColumn DataField="IsNegativeTimesheet" DataType="System.Boolean"
                HeaderText="Negative Timesheet" UniqueName="NegativeTimesheet" ReadOnly="true">
            </telerik:GridCheckBoxColumn>
            <telerik:GridCheckBoxColumn DataField="IsOvertime" DataType="System.Boolean" HeaderText="Overtime"
                UniqueName="Overtime" ReadOnly="true">
            </telerik:GridCheckBoxColumn>
        </Columns>
        <EditFormSettings UserControlName="UserControls/TimesheetEdit.ascx" EditFormType="WebUserControl">
            <EditColumn FilterControlAltText="Filter EditCommandColumn column">
            </EditColumn>
        </EditFormSettings>
    </MasterTableView>
    <PagerStyle Mode="NumericPages" VerticalAlign="Bottom" />
    <FilterMenu EnableImageSprites="False">
    </FilterMenu>
    <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Windows7">
    </HeaderContextMenu>
</telerik:RadGrid>


Column Calculation:
protected void timesheetGrid_ItemDataBound(object sender, GridItemEventArgs e)
{
    if (e.Item is GridDataItem)
    {
        GridDataItem row = e.Item as GridDataItem;
        TimeSheet item = e.Item.DataItem as TimeSheet;
        if (item != null)
        {
            double duration = item.To.TimeOfDay.TotalHours - item.From.TimeOfDay.TotalHours;
            row["Duration"].Text = duration.ToString();
        }
        else
        {
            row["Duration"].Text = "0";
        }
    }
}

Exception:

Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Expression cannot be null or empty.

Attached image.

Any help would be greatly appreciated.

Many thanks,
Daryl
Alan
Top achievements
Rank 1
 answered on 24 Feb 2011
1 answer
120 views
I'm trying to create an application that will display real-time logging of server-side events and show the status of these events within an ajaxpanel. I'm performing tasks such as extracting a zip file, copy files/folders to other locations, and deleting files and folders... all on the server where the application will be hosted.

I would like the status of each of these processes to be displayed to the user... for example:

- zip file is now being extracted... complete
- now searching for audio folder... complete
- now copying audio folder contents to driver folder... complete

... and so on

Can anyone suggest how this can be implemented?

Thanks!
Iana Tsolova
Telerik team
 answered on 24 Feb 2011
1 answer
232 views
Hi,

I have a Grid with the AutoGenerated Columns set to true and The Edit,Delete Column defined in the MasterTableView in design time. Currently the Edit and Delete columns appear to be on the left hand side and the AutoGenerated columns next to Edit and delete columns. Now we need to shift the Edit and delete columns to the right without affecting the sequence of the columns generated. We have tried swapping the columns technique but it seems to effect the sequence of autogenerated columns.

Please can you let us know the direct way to achieve this a bit urgently.

Below is the part of code for your reference which creates the Edit Delete column to the left:

<telerik

 

 

:RadGrid AutoGenerateColumns="true" ID="grid" runat="server" AllowSorting="True"

 

 

 

 

 

 

AllowPaging="true" ShowFooter="false">

 

 

 

<GroupHeaderItemStyle></GroupHeaderItemStyle>

 

 

 

<FilterMenu>

 

 

 

</FilterMenu>

 

 

 

<MasterTableView CommandItemDisplay="Top">

 

 

 

<PagerStyle Mode="NextPrevAndNumeric" />

 

 

 

<RowIndicatorColumn Visible="False" UniqueName="RowIndicator">

 

 

 

<HeaderStyle Width="20px"></HeaderStyle>

 

 

 

<ItemStyle></ItemStyle>

 

 

 

</RowIndicatorColumn>

 

 

 

<EditFormSettings>

 

 

 

<EditColumn Visible="false" UniqueName="EditCommandColumn">

 

 

 

</EditColumn>

 

 

 

</EditFormSettings>

 

 

 

<ExpandCollapseColumn Visible="False" UniqueName="ExpandColumn" ButtonType="ImageButton">

 

 

 

<HeaderStyle Width="19px"></HeaderStyle>

 

 

 

</ExpandCollapseColumn>

 

 

 

<CommandItemTemplate>

 

 

 

 

</CommandItemTemplate>

 

 

 

<Columns>

 

 

 

<telerik:GridTemplateColumn HeaderText="" UniqueName="Edit"

 

 

 

AllowFiltering="false">

 

 

 

<HeaderStyle Width="1%" />

 

 

 

<itemtemplate>

 

 

 

 

<a href="#" id="A3" title="Edit" onclick="OpenWindow(<%# DataBinder.Eval(Container.DataItem,"id") %>)">

 

<%

 

--<img onclick="javascript:handler('','ctl00_MainContentHolder_RadPanelBar3_i0_i0_grid','<%# Container.ItemIndex %>')" style="border: 0" src="images/Edit.png" alt="Edit" />--%>

 

 

 

 

<eui:eLabel ID="lblEdit" runat="server" Text="Edit" CssClass="label" ForeColor="Blue"></eui:eLabel>

 

 

 

</a>

 

 

 

</itemtemplate>

 

 

 

<itemstyle cssclass="MyImageButton" />

 

 

 

</telerik:GridTemplateColumn>

 

 

 

 

<telerik:GridTemplateColumn HeaderText="" UniqueName="Delete"

 

 

 

AllowFiltering="false">

 

 

 

<HeaderStyle Width="1%" />

 

 

 

<itemtemplate>

 

 

 

<asp:TextBox id="txt1" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "id")%>' style="display:none" ></asp:TextBox>

 

 

 

<a href="#" id='<%# DataBinder.Eval(Container.DataItem, "id")%>' title="Delete" onclick='Textt(this)'>

 

<%

 

--<img onclick="javascript:handler('','ctl00_MainContentHolder_RadPanelBar3_i0_i0_grid','<%# Container.ItemIndex %>')" style="border: 0" src="images/Delete.png" alt="Delete" />--%>

 

 

 

 

<eui:eLabel ID="lblDelete" runat="server" Text="Delete" CssClass="label" ForeColor="Blue"></eui:eLabel>

 

 

 

</a>

 

 

 

</itemtemplate>

 

 

 

<itemstyle cssclass="MyImageButton" />

 

 

 

</telerik:GridTemplateColumn>

 

 

 

 

</Columns>

 

 

 

 

<ItemStyle></ItemStyle>

 

 

 

<AlternatingItemStyle/>

 

 

 

<CommandItemStyle />

 

 

 

</MasterTableView>

 

 

 

<HeaderStyle HorizontalAlign="Center"></HeaderStyle>

 

 

 

<ClientSettings EnableRowHoverStyle="false">

 

 

 

<ClientEvents />

 

 

 

<Selecting AllowRowSelect="false"></Selecting>

 

 

 

<Resizing AllowRowResize="false" EnableRealTimeResize="false" ResizeGridOnColumnResize="false"

 

 

 

AllowColumnResize="false"></Resizing>

 

 

 

</ClientSettings>

 

 

 

</telerik:RadGrid>

 





Thanks in Advance.
Shinu
Top achievements
Rank 2
 answered on 24 Feb 2011
1 answer
223 views
hi

i have used this line to get the row index in the textchanged event but i didnt get any value and this is the line

int i = ((GridDataItem)(((RadNumericTextBox)sender).NamingContainer)).ItemIndex;
how to get the row index in text changed event
Iana Tsolova
Telerik team
 answered on 24 Feb 2011
8 answers
279 views

I've found what appears to be a bug with the bullets and number options in the Editor control.

When in the editor enter some text and click the Numbering button to give you something like this:

  1. text

Press ENTER twice to get back to a normal paragraph and then enter another line of text with a bullet.  This will either work (randomly) or will indent the text directly below the numbered list above as a bullet giving a <UL> inside of the <OL> tag above it.  If you then click the bullet button to remove the bullet it will be removed but then cannot be put back again using the button.  Once you're in this position it seems impossible to reformat everything again and the entire section must be removed including the <OL> above or you never get the items where intended.

Ironically whilst trying to give examples in this post I have come across the same problem!  I don't know if this page is using the same control or not but it's most frustrating.

Is this something you've come across?

Thanks

Dave

Rumen
Telerik team
 answered on 24 Feb 2011
6 answers
179 views
hi

how cn i change the back color of the row where i expanded a detail table?

thanks and regards
webster velasco
paul
Top achievements
Rank 1
 answered on 24 Feb 2011
1 answer
941 views
I have a RadGrid who's filter expression I am setting from a saved value in a datastore on page load.  Setting the filter programmatically seems to work just fine, however, as soon as I try to modify the filter (manually through the web interface) I loose all the filter information set in the page load method.  This only happens the first time I change the filters after loading the page.  After that, all filtering is persisted properly.  Here's the code that programmatically sets the filter expresssion:


protected void LoadFilterExpressionFromSettings(GridTableView tbView, string filterExpression, Dictionary<string, Pair> dicColumns)
{
    tbView.FilterExpression = Settings.ListFilterExpression;
    foreach(KeyValuePair<string, Pair> p in dicColumns)
    {
        tbView.GetColumn(p.Key).CurrentFilterValue = ((Pair)p.Value).First.ToString();
        tbView.GetColumn(p.Key).CurrentFilterFunction = (GridKnownFunction)((Pair)p.Value).Second;
    }
}



The FilterExpression is set on the first line.  The loop goes through each column to set the GirdFilterItem's TextBox.

------------------------------------------------------------------------------------------------------------------------------

Example (of what's going one):

RadGrid:

FirstName               LastName             Age
=================================
Bob                         Johnson                 28
Jane                        Johnson                 28
Sue                         Hanson                  28
John                        Smith                     31
Henry                      Smith                     23
Hilary                      Porter                     31 
=================================

On page load, I might set a filter for the 'LastName' column ('Johnson').  After the page loads, I try to manually filter the age column to '28' but it resets the 'LastName' column filter (to NoFilter).  When I change the 'LastName' column filter back to 'Johnson', it works just fine and the age filter persists as well.  So it's just the first change I make that resets the filters which were programmatically set.

Any help is very welcome!

Trevor



Marin
Telerik team
 answered on 24 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?