Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
206 views
Hi,

I have a GridTemplateColumn with a RadComboBox in its EditItemTeplate as follows :

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

SortExpression="FullName">

<ItemTemplate>

<asp:Label ID="lblRequestor" Width="100px" runat="server" Text='<%#Bind("RequestorID") %>'></asp:Label>

</ItemTemplate>

<EditItemTemplate>

<telerik:RadComboBox AutoPostBack="true" DataTextField="FullName" EmptyMessage="-- Select Requestor --" AppendDataBoundItems="true" DataValueField="EmployeeUserId"

ID="RadComboBox1" runat="server" SelectedValue='<%#Bind("RequestorID") %>'>

</telerik:RadComboBox>

<asp:CustomValidator ID="CustomValidator1" ControlToValidate="RadComboBox1" OnServerValidate="ValidateRequestor" runat="server" ErrorMessage="Select Requestor"></asp:CustomValidator>

</EditItemTemplate>

<ItemStyle Width="100px" />

<HeaderStyle Width="100px" />

</telerik:GridTemplateColumn>



Now, in  grid OnItemCreated="RadGrid1_ItemCreated"  event handler, based on some condition(permissions), I'm setting the above RadComboBox Enabled property to false as follows :

if (Page.User.Identity.IsAuthenticated)

{

GridTableRow tblRowForInsert = formItem[

"Requestor"].Parent as GridTableRow;

tblRowForInsert.Enabled =

false;

}

It works fine with postbacks, but, if I use AJAX, the disabled RadComboBox's borders are not shown at the bottom and the control seems to look like as if bottom half is cut.

I tried getting the RadComboBox control using the FindControl Method of GridEditableItem and then setting its Enabled property to false , but that also gives the same results with AJAX enabled.

Can you please let me know how to fix this or if there's a workaround.

Thanks
-Raj

Sebastian
Telerik team
 answered on 09 Sep 2008
1 answer
92 views
Loading data from an oracle CLOB into the rad editor - the clob contains plain text with formatting in the form of spaces and line feeds.

Code that assigns the content:
rePageEditor.Content = (String)((DataRow)dt.Rows[0])["CLOB_DATA"];

The problem is that when the editor displays the text, ALL of the existing text formatting is gone...

How do I load this type of text data into the radeditor without losing all of the existing text formatting?  The data is coming from an old system - if some html should be added during the migration that could be easily done.
Rumen
Telerik team
 answered on 09 Sep 2008
2 answers
223 views

Hello,

In my grid, I have a user control that provides functionality for my insert/updates.  I am getting the all too famous error:

"DataBinding: 'Telerik.WebControls.GridInsertionObject' does not contain a property with the name"

Now,  in my code I have so far been successful with this issue by using the following coding:

protected

void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)

{

if (e.CommandName == RadGrid.InitInsertCommandName)

{

e.Canceled =

true;

ListDictionary newValues = new ListDictionary();

newValues[

"BudgetWSTypeID"] = string.Empty;

newValues[

"ProgramNameID"] = string.Empty;

newValues[

"FiscalYearID"] = string.Empty;

ECT.....


However, if you look at the below control (where the problem is occuring), you will notice that the selected value is coming from "DataItem.Grantee.GranteeID" --  how do I add this to my listDictionary for this to work?  Perhaps I need to use a different object? 



<

rad:RadComboBox selectedvalue='<%# DataBinder.Eval( Container, "DataItem.Grantee.GranteeID") %>' MarkFirstMatch="true"

john
Top achievements
Rank 1
 answered on 09 Sep 2008
1 answer
112 views

Hi,

Please guide me how to Bind & Perform DML(Insert/Update/Delete) operations for the following scenario..

The following Example I implemented on NorthWind Database.

<

table cellpadding="0" cellspacing="0" width="100%" border="1" style="border-color: Green">

<tr>

<td>

<telerik:RadGrid ID="RadGrid1" runat="server" Skin="Default" Width="95%" AutoGenerateColumns="False"

PageSize="5" AllowSorting="True" AllowPaging="True" AllowAutomaticUpdates="True"

AllowAutomaticInserts="True" AllowAutomaticDeletes="True"

ShowStatusBar="true" onitemcreated="RadGrid1_ItemCreated"

onitemdatabound="RadGrid1_ItemDataBound"

onneeddatasource="RadGrid1_NeedDataSource">

<PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>

<MasterTableView SkinID="Default" DataKeyNames="EmployeeID"

AllowMultiColumnSorting="True" AllowAutomaticDeletes="true" AllowAutomaticUpdates="true"

AllowAutomaticInserts="true">

<DetailTables>

<telerik:GridTableView SkinID="Default" DataKeyNames="EmployeeID, OrderID" DataSourceID="nestedTableSource" Name="GrdTableView" Width="100%"

runat="server" AllowAutomaticDeletes="true" AllowAutomaticInserts="true" AllowAutomaticUpdates="true"

CommandItemDisplay="Top">

<ParentTableRelation>

<telerik:GridRelationFields DetailKeyField="EmployeeID" MasterKeyField="EmployeeID" />

</ParentTableRelation>

<Columns>

<telerik:GridBoundColumn SortExpression="OrderID" HeaderText="OrderID" HeaderButtonType="TextButton"

DataField="OrderID" UniqueName="OrderID" ReadOnly="true">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn SortExpression="ShipVia" HeaderText="Ship via" HeaderButtonType="TextButton"

DataField="ShipVia" UniqueName="ShipVia">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn SortExpression="ShipName" HeaderText="Ship name" HeaderButtonType="TextButton"

DataField="ShipName" UniqueName="ShipName">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn SortExpression="ShipCity" HeaderText="Ship city" HeaderButtonType="TextButton"

DataField="ShipCity" UniqueName="ShipCity">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn SortExpression="ShipCountry" HeaderText="Ship country" HeaderButtonType="TextButton"

DataField="ShipCountry" UniqueName="ShipCountry">

</telerik:GridBoundColumn>

<telerik:GridEditCommandColumn UniqueName="EditCommandColumn" />

<telerik:GridButtonColumn UniqueName="DeleteColumn" Text="Delete" CommandName="Delete" />

</Columns>

</telerik:GridTableView>

</DetailTables>

<Columns>

<telerik:GridBoundColumn SortExpression="EmployeeID" HeaderText="EmployeeID" HeaderButtonType="TextButton"

DataField="EmployeeID" UniqueName="EmployeeID" ReadOnly="true">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn SortExpression="FirstName" HeaderText="First name" HeaderButtonType="TextButton"

DataField="FirstName" UniqueName="FirstName">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn SortExpression="LastName" HeaderText="Last name" HeaderButtonType="TextButton"

DataField="LastName" UniqueName="LastName">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn SortExpression="Address" HeaderText="Address" HeaderButtonType="TextButton"

DataField="Address" UniqueName="Address">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn SortExpression="City" HeaderText="City" HeaderButtonType="TextButton"

DataField="City" UniqueName="City" />

<telerik:GridBoundColumn SortExpression="Country" HeaderText="Country" HeaderButtonType="TextButton"

DataField="Country" UniqueName="Country">

</telerik:GridBoundColumn>

</Columns>

</MasterTableView>

</telerik:RadGrid>

<asp:SqlDataSource ID="nestedTableSource" SelectCommand="SELECT [OrderID],[EmployeeID], [ShipVia], [ShipName], [ShipCity], [ShipCountry] FROM [Orders] WHERE ([EmployeeID] = @EmployeeID)"

runat="server" ConflictDetection="CompareAllValues" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"

DeleteCommand="DELETE FROM [Orders] WHERE [OrderID] = @original_OrderID" InsertCommand="INSERT INTO [Orders] ([EmployeeID], [ShipVia], [ShipName], [ShipCity], [ShipCountry]) VALUES (@EmployeeID, @ShipVia, @ShipName, @ShipCity, @ShipCountry)"

OldValuesParameterFormatString="original_{0}" UpdateCommand="UPDATE [Orders] SET [ShipVia] = @ShipVia, [ShipName] = @ShipName, [ShipCity] = @ShipCity, [ShipCountry] = @ShipCountry WHERE [OrderID] = @original_OrderID AND [ShipVia] = @original_ShipVia AND [ShipName] = @original_ShipName AND [ShipCity] = @original_ShipCity AND [ShipCountry] = @original_ShipCountry">

<SelectParameters>

<asp:SessionParameter Name="EmployeeID" SessionField="EmployeeID" Type="Int32" Direction="Input" />

</SelectParameters>

<DeleteParameters>

<asp:Parameter Name="original_OrderID" Type="Int32" />

</DeleteParameters>

<UpdateParameters>

<asp:Parameter Name="ShipVia" Type="Int32" />

<asp:Parameter Name="ShipName" Type="String" />

<asp:Parameter Name="ShipCity" Type="String" />

<asp:Parameter Name="ShipCountry" Type="String" />

<asp:Parameter Name="original_OrderID" Type="Int32" />

<asp:Parameter Name="original_ShipVia" Type="Int32" />

<asp:Parameter Name="original_ShipName" Type="String" />

<asp:Parameter Name="original_ShipCity" Type="String" />

<asp:Parameter Name="original_ShipCountry" Type="String" />

</UpdateParameters>

<InsertParameters>

<asp:SessionParameter Name="EmployeeID" SessionField="EmployeeID" Type="Int32" />

<asp:Parameter Name="ShipVia" Type="Int32" />

<asp:Parameter Name="ShipName" Type="String" />

<asp:Parameter Name="ShipCity" Type="String" />

<asp:Parameter Name="ShipCountry" Type="String" />

</InsertParameters>

</asp:SqlDataSource>

</td>

</tr>

</table>

Princy
Top achievements
Rank 2
 answered on 09 Sep 2008
1 answer
117 views
Hello,

I binded my RadGrid to a Aspdatasource in designview. The columns are: Student_ID, Sport_ID
A student belongs to a sport. Is there a design-way i can add a column displaying the Sportname, instead of the ID. So actually retrieving data from the Sport table and combining it with other table data.(multi-source grid?)

I assume i need to place another datasource for Sport and then binding it to the new added column.

Your help is highly appreciated

~Guen~
Shinu
Top achievements
Rank 2
 answered on 09 Sep 2008
1 answer
133 views
Hello,

I have boiled down my problem to the following simple example:

Here is the table, to which I just bind a select * query.

Name            Date              Weight 
John    2008-08-29      300 
John    2008-09-05      295 
John    2008-09-10      290 
Jane    2008-08-29      150 
Jane    2008-09-05      140 
Jane    2008-09-10      130 

The end result that I am looking for is a line graph that has a line for each person, showing the progress of weight over time.  In an attempt to achieve this, in the wizard, I turned on grouping for the "Name" column.  This seems to give the right effect within the wizard, for some reason, the lines don't come out correctly.

Here is the line graph version, which has the lines sitting on top of each other.
Line Graph

Here's a bar graph version, which makes it easier to see what is going on.
Bar Graph

I don't understand why the second series (Jane) has the same values as the first series.  Inside the wizard, when I click on the Jane series, the three "series items" for Jane are correct.

I feel like I'm missing some fundamental thing about how the graph is supposed to work.  Any help is appreciated.

Thanks,
Stephen
Ves
Telerik team
 answered on 09 Sep 2008
2 answers
135 views
hi!
i would like to position tooltip to render windows xp like toolbar tooltip.


<telerik:RadToolTip runat="server" ID="CornerMsg" RelativeTo="Element" Position="TopLeft"
OffsetX="0" OffsetY="0" ContentScrolling="None" Skin="Web20"
Width="150" Height="70" Animation="Fade" ShowCallout="true" IsClientID="true"
TargetControlID="rightCornerPlacer">
<div>
<asp:Label runat="server" ID="Message">Event message</asp:Label>
</div>
</telerik:RadToolTip>
this i put as first element and in asp:content...and then i use

<div id="rightCornerPlacer" style="position:absolute; position:fixed; bottom:0px; right:20px; overflow:hidden; width:0px; height:0px;">
Do not delete this! this is important for correct tooltip functionality!
</div>
at bottom of asp:content.

It renders correctly but there are still few problems. Like, it will eventually disappear, but if u try to scroll, it will not stay fixed to the window (it will be scrolled).

Problem is that Tooltip doesn't render correctly when we use RelativeTo="BrowserWindow". problem is that in this case of scrolling, origin div is absolute and not alligned to scroll box. When i look at example demo of telerik,  this scroll is resolved, and it is aligned correctly, only Position="TopLeft" doesn't give me ability to place it as Position="BottomRight" in respect to window.

Is there any workarround for this? Could i use something that control allready uses for generating correct position as on demo?
http://demos.telerik.com/ASPNET/Prometheus/ToolTip/Examples/RelativeTo/DefaultCS.aspx

Vjeran
Top achievements
Rank 2
 answered on 09 Sep 2008
6 answers
140 views

Hello!

I've used "Business Grid demo" to build my own sample app from.
I have a setup with main table, .persons (access db) containing names and ID for their workingplace and a table, .workingplace containing the names of the workingplace.
When i try to update the form a get an OleDbException error. "Data type mismatch in criteria expression".
I have been trying for days to solve this probably easy error but without any luck. Hope somebody can help me out here.
I'm running the app with ASP.NET-version:2.0.50727.3053  and Telerik RadGrid.Net2.dll ver 5.0.1.0

Regards

Janne P

Here's my code:

The Grid:

<

radG:RadGrid ID="DetailsGrid" runat="server" AutoGenerateColumns="False" GridLines="None" DataSourceID="ds_details" EnableAJAXLoadingTemplate="True" LoadingTemplateTransparency="15" ShowHeader="False" AllowAutomaticUpdates="True" AllowAutomaticInserts="True" EnableAJAX="True" OnItemInserted="DetailsGrid_ItemInserted" OnItemUpdated="DetailsGrid_ItemUpdated" OnPreRender="DetailsGrid_PreRender" OnCancelCommand="DetailsGrid_CancelCommand" OnItemCreated="DetailsGrid_ItemCreated" OnInsertCommand="DetailsGrid_InsertCommand" Width="464px" Style="overflow: hidden;">

<MasterTableView DataSourceID="ds_details" DataKeyNames="fldInstId" Width="219px">
<Columns>
<radG:GridBoundColumn DataField="fldIdNr" HeaderText="IdNr" UniqueName="fldIdNr" ColumnEditorID="TextEditor" />

<radG:GridBoundColumn DataField="fldFnamn" HeaderText="Förnamn" UniqueName="fldFnamn" ColumnEditorID="TextEditor" />

<radG:GridBoundColumn DataField="fldEnamn" HeaderText="Efternamn" UniqueName="fldEnamn" ColumnEditorID="TextEditor" />

<radG:GridDropDownColumn DataField="fldInstId" ListTextField="fldNamn" ListValueField="fldIdNr"ColumnEditorID="DropDownEditor1" DataSourceID="ds_arbetsplats" HeaderText="Arbetsplats" UniqueName="fldInstId" DataType="System.Int32" />

<radG:GridBoundColumn DataField="fldTitle" HeaderText="Titel" UniqueName="fldTitle" ColumnEditorID="TextEditor"/>
</Columns>
</MasterTableView>

</radG:RadGrid>

The data source for the grid:

<

asp:SqlDataSource ID="ds_details" runat="server"
ConnectionString="<%$ ConnectionStrings:conn_clients %>"
DeleteCommand="DELETE FROM [tblDr] WHERE [fldIdNr] = ?" InsertCommand="INSERT INTO [tdlDr] ([fldFnamn], [fldEnamn]) VALUES (?, ?)" ProviderName="<%$ ConnectionStrings:conn_clients.ProviderName %>" SelectCommand="SELECT fldIdNr, fldFnamn, fldEnamn, fldInstId, fldTitle FROM tblDr WHERE (fldIdNr = ?)"
UpdateCommand="UPDATE tblDr SET fldFnamn = ?, fldEnamn = ?, fldInstId = ?, fldTitle = ? WHERE (fldIdNr = ?)">
<SelectParameters>
<asp:ControlParameter ControlID="BusinessGrid" DefaultValue="" Name="fldIdNr" PropertyName="SelectedValue" Type="Int32" />
</SelectParameters>
<UpdateParameters>
<asp:Parameter Name="fldFnamn" Type="String" />
<asp:Parameter Name="fldEnamn" Type="String" />
<asp:Parameter Name="fldInstId" Type="Int16" />
<asp:Parameter Name="fldTitle" Type="String" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="fldFnamn" Type="String" />
<asp:Parameter Name="fldEnamn" Type="String" />
</InsertParameters>
<DeleteParameters>
<asp:Parameter Name="fldIdNr" Type="Int32" />
</DeleteParameters>
</asp:SqlDataSource>

 Data source for the dropdowncolumn:

<asp:SqlDataSource ID="ds_arbetsplats" runat="server"
ConnectionString="<%$ ConnectionStrings:conn_clients %>"
ProviderName="<%$ ConnectionStrings:conn_clients.ProviderName %>" SelectCommand="SELECT [fldIdNr], [fldNamn] FROM [tblInstitutioner]">
</asp:SqlDataSource>

Jan
Top achievements
Rank 1
 answered on 09 Sep 2008
9 answers
384 views
Hi,
I am using a Rad-Grid for hierarchical display of data, i.e. when a row in the Master grid is expanded, the child grid opens up. I am using a Gray skin for my grid. What I want is that even after expanding the rows in the Master grid, the resulting grid should still have an alternating white and gray rows. Please help me out. I am attaching the mark-up of my case.

<

html xmlns="http://www.w3.org/1999/xhtml">
<
head runat="server">
<title>Untitled Page</title>
</head>
<
body>

<form id="form1" runat="server">

<div>

</div>

<telerik:RadScriptManager ID="RadScriptManager1" Runat="server">

</telerik:RadScriptManager>

<div>

<telerik:RadGrid ID="RadGrid1" runat="server" Skin="Gray" Width="470px" AutoGenerateColumns="False">

<

MasterTableView DataKeyNames="GroupID" Width="100%" HorizontalAlign="Right">

<

RowIndicatorColumn>

<

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

</

RowIndicatorColumn>

<

ExpandCollapseColumn>

<

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

</

ExpandCollapseColumn>

<

DetailTables>

<

telerik:GridTableView DataKeyNames="GroupID" Width="100%" ShowHeader="false" TableLayout="Auto" BorderStyle="None" HorizontalAlign="Right">

<

ParentTableRelation>

<

telerik:GridRelationFields MasterKeyField="GroupID" DetailKeyField="GroupID" />

</

ParentTableRelation>

<

RowIndicatorColumn>

<

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

</

RowIndicatorColumn>

<

ExpandCollapseColumn>

<

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

</

ExpandCollapseColumn>

<

Columns>

<

telerik:GridBoundColumn DataField="NameID"> <HeaderStyle Width="115px" /></telerik:GridBoundColumn>

<

telerik:GridBoundColumn HeaderText="Name" DataField="Name"><HeaderStyle Width="157px" /></telerik:GridBoundColumn>

<

telerik:GridBoundColumn HeaderText="Date" DataField="CreatedDate" DataFormatString="{0:d}"><HeaderStyle Width="155px" /></telerik:GridBoundColumn>

<

telerik:GridBoundColumn HeaderText="Active" DataField="Active"><HeaderStyle Width="125px" /></telerik:GridBoundColumn>

</

Columns>

 

</

telerik:GridTableView>

</

DetailTables>

<

Columns>

<

telerik:GridBoundColumn HeaderText="Group ID" DataField="GroupID"><HeaderStyle Width="150px" /></telerik:GridBoundColumn>

<

telerik:GridBoundColumn HeaderText="Name" DataField="GroupName"><HeaderStyle Width="200px" /></telerik:GridBoundColumn>

<

telerik:GridBoundColumn HeaderText="Date" DataField="CreatedDate" DataFormatString="{0:d}"><HeaderStyle Width="200px" /></telerik:GridBoundColumn>

<

telerik:GridBoundColumn HeaderText="Active" DataField="Active"><HeaderStyle Width="150px" /></telerik:GridBoundColumn>

</

Columns>

 

</

MasterTableView>

<

FilterMenu EnableTheming="True">

<

CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>

</

FilterMenu>

</telerik:RadGrid>

</div>

<asp:SqlDataSource ID="SqlDataSource1" runat="server"

ConnectionString="<%$ ConnectionStrings:FPSCoreDevConnectionString3 %>"

SelectCommand="SELECT * FROM [LookupGroup]"></asp:SqlDataSource>

<asp:SqlDataSource ID="SqlDataSource2" runat="server"

ConnectionString="<%$ ConnectionStrings:FPSCoreDevConnectionString3 %>"

SelectCommand="SELECT * FROM [LookupName]"></asp:SqlDataSource>

</form>

</

body>

</

html>

Dimo
Telerik team
 answered on 09 Sep 2008
2 answers
255 views
I have a page that is throwing an error when I use an iframe inside a RadMultiPage.

<body> 
    <form id="form1" runat="server">  
    <div> 
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server" /> 
        <telerik:RadTabStrip ID="RadTabStrip1" runat="server" Skin="Office2007" SelectedIndex="0" MultiPageID="RadMultiPage1">  
            <Tabs> 
                <telerik:RadTab Text="General" /> 
                <telerik:RadTab Text="Pages" /> 
                <telerik:RadTab Text="Users" /> 
                <telerik:RadTab Text="SEO" /> 
                <telerik:RadTab Text="Help" /> 
            </Tabs> 
        </telerik:RadTabStrip> 
        <div id="Inner">  
            <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0">  
                <telerik:RadPageView ID="RadPageView1" runat="server">  
                    RadPageView1  
                </telerik:RadPageView> 
                <telerik:RadPageView ID="RadPageView2" runat="server">  
                    RadPageView2  
                </telerik:RadPageView> 
                <telerik:RadPageView ID="RadPageView3" runat="server">  
                    RadPageView3  
                </telerik:RadPageView> 
                <telerik:RadPageView ID="RadPageView4" runat="server">  
                    RadPageView4  
                </telerik:RadPageView> 
                <telerik:RadPageView ID="RadPageView5" runat="server">  
                    <iframe width="100%" height="100%" src="http://mysite.com/help.html"></iframe> 
                </telerik:RadPageView> 
            </telerik:RadMultiPage> 
        </div> 
    </div> 
    </form> 
</body> 

The error says
"Error: Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus."
Atanas Korchev
Telerik team
 answered on 09 Sep 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?