Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
566 views
This seems like it should be a straight forward thing to do, but it's eluding me, and I've searched for an answer. Hopefully I'm overlooking something simple.

I'm binding my RadGrid to an entity data source. I'm using GridTemplateColumn columns for many of the columns, as I combine several of the data fields into one column. How do I access the RadGrid datasource's field values (in the code-behind)? This is in non-edit, regular view of the grid.

For example, I'd like to do something like this:
protected void ContactsGrid_ItemDataBound(object sender, GridItemEventArgs e)
{
    if ((!e.Item.IsInEditMode) && (e.Item is GridDataItem))
    {
        GridDataItem dataItem = (GridDataItem)e.Item;
 
        // Assuming my entity data source has a field named "dataFieldName", would be nice to access:
        string dataFieldValue = (string)dataItem("dataFieldName").Value;
        // Would then find the GridTemplateColumn in order to fill in the ItemTemplate, 
        // which already know how to do...
    }
}


Thanks,
Steve
Tsvetoslav
Telerik team
 answered on 06 Jul 2011
1 answer
62 views
Hi,

I am using rad editor to edit some text. I have a edit button to edit text on radeditor
On the edit button click I am setting some property of radeditor.

 

 

<telerik:RadEditor ID="radEditor" runat="server" Enabled="false" Skin="Office2007" TextMode="MultiLine" Width="625px"></telerik:RadEditor>

 



radEditor.Enabled = 

true;
radEditor.Width = 625; 

radEditor.ToolsFile = 

"RadEditorBasicToolSet.xml";

After I click on edit button, I have to click twice on text in the radeditor to edit. I don't want to click twice to edit the text. How can I fix that double click issue.

Thanks

Rumen
Telerik team
 answered on 06 Jul 2011
1 answer
67 views
I am using a RadListView per the sample at http://www.telerik.com/help/aspnet-ajax/listview-datapager-for-paging.html
The Datapager is in the layout template. I want to access the PageSize of the Radpager in the code behind but I can not find it to set. Since it is in the Layout template it is not visible in the VS dropdown. I tried to simply place a value in the PageSize using <% =value%> and I get an error saying that the string value cannot be translated to Int32. I verified that the value is in fact a number. I tried to do a RadListView1.LayoutTemplate.FindControl but this not supported. Please help, my client really wants to be able to set this page size dynamically and I can find no way to get to this.

Thanks in advance for your help.

Terry
Mira
Telerik team
 answered on 06 Jul 2011
5 answers
184 views
I like to use a validation summary alert with the RadInputManager. Can anyone provide me with an example?

Kind regards,
Dick van Straaten
Mira
Telerik team
 answered on 06 Jul 2011
4 answers
184 views
Hello,

I'm having problems to add Aggregate to a GridCalculatedColumn.

This is my code (due to space I'm only copying a part of it):

<telerik:GridTableView runat="server" AllowSorting="true" DataKeyNames="QuotationLineId"
    Caption="Quotation Lines" Name="QuotationLines" PageSize="10"
    CommandItemDisplay="Top" AllowPaging="true" AutoGenerateColumns="False"
    GridLines="None" AllowFilteringByColumn="false" ShowFooter="True">
 
    <Columns>
        <telerik:GridButtonColumn ButtonType="ImageButton" Reorderable="False"
            Resizable="False" ShowFilterIcon="False" ShowSortIcon="False"
            UniqueName="EditButton" ImageUrl="~/Images/Edit.png" CommandName="Edit">
            <ItemStyle Width="20px" HorizontalAlign="Center" VerticalAlign="Middle" />
        </telerik:GridButtonColumn>
        <telerik:GridBoundColumn DataField="QuotationLineId" HeaderText="Id"
            UniqueName="QuotationLineId" Visible="false">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn HeaderText="Units" DataField="Units" UniqueName="Units" ItemStyle-Width="25px"
            ItemStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Right" DataFormatString="{0:0.00}">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn HeaderText="Description" DataField="Description" UniqueName="Description">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn HeaderText="Cost" DataField="Cost" UniqueName="Cost" ItemStyle-HorizontalAlign="Right"
            HeaderStyle-HorizontalAlign="Right" DataFormatString="{0:c}" ItemStyle-Width="65px">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn HeaderText="Price" DataField="Price" UniqueName="Price" ItemStyle-HorizontalAlign="Right"
            HeaderStyle-HorizontalAlign="Right" DataFormatString="{0:c}" ItemStyle-Width="65px">
        </telerik:GridBoundColumn>
        <telerik:GridCalculatedColumn UniqueName="TotalCost" HeaderText="Total Cost"
            DataFields="Units, Cost" Expression='{0}*{1}' ItemStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Right"
            DataFormatString="{0:c}" ItemStyle-Width="65px" Aggregate="Sum" FooterStyle-HorizontalAlign="Right"
            FooterAggregateFormatString="{0:c}">
        </telerik:GridCalculatedColumn>
        <telerik:GridCalculatedColumn UniqueName="TotalPrice" HeaderText="Total Price"
            DataFields="Units, Price" Expression='{0}*{1}' ItemStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Right"
            DataFormatString="{0:c}" ItemStyle-Width="65px">
        </telerik:GridCalculatedColumn>
        <telerik:GridCalculatedColumn UniqueName="Margin" HeaderText="Margin"
            DataFields="Cost, Price" Expression='1-({0}/{1})' ItemStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Right"
            DataFormatString="{0:0.00%}" ItemStyle-Width="25px">
        </telerik:GridCalculatedColumn>
        <telerik:GridButtonColumn ButtonType="ImageButton" Reorderable="False"
            Resizable="False" ShowFilterIcon="False" ShowSortIcon="False"
            UniqueName="DeleteButton" ImageUrl="~/Images/Delete.png" CommandName="Delete"
            ConfirmDialogType="RadWindow" ConfirmText="Are you sure you want to delete this record?" ConfirmTitle="Delete record..."
            ConfirmDialogHeight="130px">
            <ItemStyle Width="20px" HorizontalAlign="Center" VerticalAlign="Middle" />
        </telerik:GridButtonColumn>
    </Columns>
 
</telerik:GridTableView>


The error is:

Microsoft JScript runtime error:
Sys.WebForms.PageRequestManagerServerErrorException: Exception has been thrown by the target of an invocation.

If I write the same code in a bind column all works fine.

Regards
Jose
Mira
Telerik team
 answered on 06 Jul 2011
8 answers
62 views
Hi, I have a scheduler and 2 listbox on a project and it is working fine all along.

But out of a sudden, all telerik controls cannot be display properly. Attached below shows how it is displayed.

It is a urgent matter, hope to receive good news and reply as soon as possible.

Cheers!
Georgi Tunev
Telerik team
 answered on 06 Jul 2011
1 answer
586 views
I have a datatable that has the following values

Item   Value
C1      12
C2      14
C12    25
C24    30
Dist     90
site     24

I want to create two pie charts. In the First pie chart, i want tos how the C1, C2 and c12 on the pie chart and along with the series. in the series, I want tos how C1, c2 and C12
In the second pie chart, i want to show C24, dist and site. how can I acheive this.

any help will be appreciated.

Thanks

Evgenia
Telerik team
 answered on 06 Jul 2011
11 answers
239 views
I have a radgrid on my page and I have it set up so that I allow multiple selections via a checkbox.

I want to be able to get the selected rows checked and update their field(status) to a certain value.

I want to use a command button for this. the user will select the records and click the button which will update "status" to "confirmed".

Is this possible to be done through a stored procedure? If not, just through vb.net

Thanks

Andrew
Top achievements
Rank 1
 answered on 06 Jul 2011
2 answers
67 views
You mentioned that this problem will be fixed in next release.
What is the status of it?



Related to: http://www.telerik.com/community/forums/aspnet/general-discussions/radcolorpicker-doesn-t-display-palette-tabs.aspx
Roman
Top achievements
Rank 1
 answered on 06 Jul 2011
1 answer
63 views
Hi eveybody,
I'm tring to create schedule page. And I used this sample http://demos.telerik.com/aspnet-ajax/scheduler/examples/outlook2007/defaultcs.aspx . And my page has a menu which it can close and open. So I want to refresh my schedule/splitter size when i close or open my menu. Actually It works when I change main explorer window size. But I couldn't find which method is calling from schedule or splitter. So How Can I handle it?

Thanks
Gökhan
Plamen
Telerik team
 answered on 06 Jul 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?