Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
133 views
the question as the title:What's the differences between <%# Eval("Name")%> and <% #Eval("Name")%>?? I do not know why,When I Binded the data on the RadGrid I should use <%# Eval("Name")%> ,while when i binded the client-side event <% #Eval("Name")%> is right.
Liz Danniel
Top achievements
Rank 1
 asked on 26 May 2010
3 answers
130 views
I don't know what's the reason,it occur this error.I tried some methods,all doesn't work,can someone give me some ideas?
My version is 2009.1.402.35.My .Net FrameWork is .Net 3.5.
<
body> 
    <form id="form1" runat="server"
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server"
    </telerik:RadScriptManager> 
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"  > 
        <AjaxSettings> 
         
            <telerik:AjaxSetting AjaxControlID="cbxSolvedOrNo" > 
                <UpdatedControls > 
                    <telerik:AjaxUpdatedControl ControlID="lblWishTime" LoadingPanelID="RadAjaxPanel1" /> 
                    <telerik:AjaxUpdatedControl ControlID="rdtpWishTime" LoadingPanelID="RadAjaxPanel1" /> 
                    <telerik:AjaxUpdatedControl ControlID="dltServices" LoadingPanelID="RadAjaxPanel1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
    </telerik:RadAjaxManager> 
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server"
    </telerik:RadAjaxPanel> 
    <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" /> 
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"
 
    <table class="table" width="805px"
        
        <tr> 
            <td> 
                <table class="table" width="100%" border="0"
                    <tr> 
                        <td align="right" style="width: 120px;"
                            <asp:CustomValidator ID="cvUser" runat="server" ErrorMessage="必填" OnServerValidate="cvUser_ServerValidate" 
                                SetFocusOnError="true"></asp:CustomValidator>&nbsp;请&nbsp;&nbsp;求&nbsp;&nbsp;人: 
                        </td> 
                        <td style="width: 150px;"
                            <uc1:USelectUser ID="USelectUser1" runat="server" Width="150" ExtSeleClientEvent="selectUserObj" /> 
                        </td> 
                       
                    </tr> 
                </table> 
            </td> 
        </tr> 
        <tr> 
            <td> 
                <table class="table" width="100%"
                    <tr> 
                        <td align="right" style="width: 120px;"
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="rblEnventSource" 
                                ErrorMessage="必填" SetFocusOnError="True"></asp:RequiredFieldValidator>&nbsp;事件来源: 
                        </td> 
                        <td align="left"
                            <asp:RadioButtonList ID="rblEnventSource" runat="server" CellPadding="0" CellSpacing="5" 
                                RepeatLayout="Table" RepeatDirection="Horizontal"
                            </asp:RadioButtonList> 
                        </td> 
                        <td align="right" style="width: 80px;"
                            临时电话: 
                        </td> 
                        <td align="left" style="width: 110px;"
                            <telerik:RadTextBox ID="rtxtTelephone" runat="server" Width="90px"
                            </telerik:RadTextBox> 
                        </td> 
                    </tr> 
                </table> 
            </td> 
        </tr> 
        <tr> 
            <td> 
                <table class="table" width="100%"
                    <tr> 
                        <td align="right" style="width: 120px;"
                            <asp:RequiredFieldValidator ID="rfvWishTime" runat="server" ErrorMessage="必填" ControlToValidate="rdtpWishTime" 
                                SetFocusOnError="True"></asp:RequiredFieldValidator>&nbsp;<asp:Label ID="lblWishTime" 
                                    runat="server" Text="期望解决时间:"></asp:Label> 
                        </td> 
                        <td align="left" style="width: 260px;"
                            <telerik:RadDateTimePicker ID="rdtpWishTime" runat="server" Width="145px"
                            </telerik:RadDateTimePicker> 
                            <asp:CompareValidator ID="cvWishTime" runat="server" ControlToCompare="rdtpRequestTime" 
                                ControlToValidate="rdtpWishTime" ErrorMessage="期望应大于请求日期!" Operator="GreaterThanEqual" 
                                SetFocusOnError="True"></asp:CompareValidator> 
                        </td> 
                        <td align="right" style="width: 60px; visibility: hidden;"
                            请求时间: 
                        </td> 
                        <td align="left" style="visibility: hidden;"
                            <telerik:RadDateTimePicker ID="rdtpRequestTime" runat="server" Width="150px"
                            </telerik:RadDateTimePicker> 
                        </td> 
                        <td align="left" style="width: 180px;"
                            <asp:CheckBox ID="cbxSolvedOrNo" runat="server" Text="是否直接解决" OnCheckedChanged="cbxSolvedOrNo_CheckedChanged" 
                                AutoPostBack="true" /> 
                            <asp:CheckBox ID="cbxReqairForm" runat="server" Text="是否为补单" OnCheckedChanged="cbxReqairForm_CheckedChanged" 
                                AutoPostBack="true" /> 
                        </td> 
                    </tr> 
                </table> 
            </td> 
        </tr> 
        <tr> 
            <td> 
                <table class="table" width="100%"
                    <tr> 
                        <td align="right" style="width: 120px;"
                            用户请求内容: 
                        </td> 
                        <td> 
                            <telerik:RadTextBox ID="rtxbRequestContent" runat="server" Width="99%" Height="60px" 
                                TextMode="MultiLine" EmptyMessage="请输入用户请求内容"
                            </telerik:RadTextBox> 
                        </td> 
                    </tr> 
                </table> 
            </td> 
        </tr> 
        <tr> 
            <td> 
                <table class="table" width="100%"
                    <tr> 
                        <td style="width: 120px" align="right"
                            备&nbsp;&nbsp;注: 
                        </td> 
                        <td> 
                            <telerik:RadTextBox ID="rtxbNote" runat="server" Width="99%" Height="40px" TextMode="MultiLine" 
                                ToolTip="备注" EmptyMessage="请输入备注内容"
                            </telerik:RadTextBox> 
                        </td> 
                    </tr> 
                    <tr> 
                        <td style="width: 120px" align="right"
                            上传附件: 
                        </td> 
                        <td> 
                            <asp:UpdatePanel runat="server" ID="UpdatePanel1"
                                <ContentTemplate> 
                                    <asp:FileUpload ID="FileUpload1" runat="server" CssClass="content" Width="300px" /> 
                                </ContentTemplate> 
                                <Triggers> 
                                    <asp:PostBackTrigger ControlID="btnSave" /> 
                                </Triggers> 
                            </asp:UpdatePanel> 
                        </td> 
                    </tr> 
                    <tr> 
                        <td> 
                            &nbsp; 
                        </td> 
                        <td> 
                            <asp:LinkButton ID="lbtnDownload" runat="server" ToolTip="下载" OnClick="lbtnDownload_Click"></asp:LinkButton> 
                        </td> 
                    </tr> 
                </table> 
            </td> 
        </tr> 
        <div id="dltServices" runat="server"
            <tr> 
                <td> 
                    <span style="margin-left: 5px;"><b>服务单信息</b></span>&nbsp;<asp:CustomValidator ID="cvServices" 
                        runat="server" ErrorMessage="必选其一" OnServerValidate="cvServices_ServerValidate" 
                        SetFocusOnError="True"></asp:CustomValidator> 
                </td> 
            </tr> 
            <%-- <asp:UpdatePanel ID="UpdatePanel2" runat="server"
        <ContentTemplate>--%> 
            <tr> 
                <td> 
                    <table class="table" width="100%"
                        <tr> 
                            <td> 
                                <div> 
                                    <asp:DataList ID="dlServices" runat="server" Width="100%" DataKeyField="ID" OnItemDataBound="dlServices_ItemDataBound"
                                        <HeaderTemplate> 
                                            <table width="100%"
                                        </HeaderTemplate> 
                                        <ItemTemplate> 
                                            <tr> 
                                                <td style="width: 150px;" align="left"
                                                    <asp:Label ID="lblKeyID" runat="server" Text='<%#Eval("ID") %>' Visible="false"></asp:Label> 
                                                    <asp:CheckBox ID="chkItem" runat="server" Text='<%#Eval("ServiceType") %>' /> 
                                                </td> 
                                                <td align="left"
                                                    <%--  <telerik:RadTextBox ID="txtApply" runat="server" Width="90%" TextMode="MultiLine" 
                                                    EmptyMessage="请输入申请内容" Height="40px" CausesValidation="true"
                                                </telerik:RadTextBox>--%> 
                                                    <asp:TextBox ID="txtApply" runat="server" TextMode="MultiLine" Height="40px" Width="99%"></asp:TextBox> 
                                                </td> 
                                            </tr> 
                                        </ItemTemplate> 
                                        <FooterTemplate> 
                                            </table> 
                                        </FooterTemplate> 
                                    </asp:DataList> 
                                </div> 
                            </td> 
                        </tr> 
                    </table> 
                </td> 
            </tr> 
        </div> 
        <%--</ContentTemplate> 
        <Triggers> 
        <asp:AsyncPostBackTrigger  ControlID="cbxSolvedOrNo" EventName="CheckedChanged"/> 
        </Triggers> 
          </asp:UpdatePanel>--%> 
        <tr> 
            <td align="center" style="height: 40px;"
                <asp:Button ID="btnSave" runat="server" Text="受理" Width="80px" OnClick="btnSave_Click" />&nbsp; 
                <asp:Button ID="btnStop" runat="server" Text="暂存" Width="80px" OnClick="btnStop_Click" />&nbsp; 
                <input id="Button1" type="button" value="返回" onclick="Close()" style="width: 80px;" /> 
            </td> 
        </tr> 
    </table> 
    </form> 
</body> 

  protected void cbxSolvedOrNo_CheckedChanged(object sender, EventArgs e) 
    { 
        lblWishTime.Visible = !cbxSolvedOrNo.Checked; 
        rdtpWishTime.Visible = !cbxSolvedOrNo.Checked; 
        rfvWishTime.Enabled = !cbxSolvedOrNo.Checked; 
        cvWishTime.Enabled = !cbxSolvedOrNo.Checked; 
        EnableServiceList(cbxSolvedOrNo.Checked); 
        dltServices.Visible = !cbxSolvedOrNo.Checked; 
 
    } 

Dimo
Telerik team
 answered on 26 May 2010
3 answers
75 views
Dear all,

In my master page i am using formdecorator,splitter,menu,tab and in content page i am using radgrid.So i want to know it is possible to load webresource or scriptresource files for that controls.I have not mentioned anywhere and it is taking default for all controls.Pzs i want ur help and give me example.

Best rgds
Azeheruddin khan

Vinkel
Top achievements
Rank 1
 answered on 26 May 2010
11 answers
627 views
Hello all

I have the following issue, I searched the demos and the forum and I didn't find what I want:

I have a grid with master table, and this grid have a detailed table which bounded on demand using DetailTableDataBind, ie when the user clicks expand button the detail table appears filled with data.

Also I have GridClientSelectColumn for the master and the detail (all the columns are coded in ASPX page NOT AutoGenerated)

<telerik:GridClientSelectColumn UniqueName="selColumn"
</telerik:GridClientSelectColumn> 



what I need is when the user clicks the Select checkbox for the master table, ALL rows in the detail table must be selected, and when the user clears (deselect) the checkbox of the master table, ALL the rows in the detail table must be cleared. Of course this must happen in client side functions or APIs (JavaScript).

Please help me ASAP..

Thanks in advance

Regards..
Yavor
Telerik team
 answered on 26 May 2010
1 answer
122 views
Hi all,
I'm newbie in web application testing mostly using ASP.net.
I'd like to ask is there anybody here had experience in testing row selection in Gridview using check box?

What behavior expected from row selection if all check box are checked then unchecked at bottom of the rows, at first row and the middle position of rows in grid view ?
included in the attachment for viewing to what I meant above matter.

Your valuable information or other references will be appreciated and I'm sorry if I entered the wrong forums.

Thanks and regards,
ikadewi

Pavlina
Telerik team
 answered on 26 May 2010
1 answer
80 views
Hello,

I'm designing a grid editing the individual records "InSite", using a Edit/Update-Cancel button, after push Edit Button, the row becames editable and I change some values, but when I push "Update" the labels  are still showing the original values, they don't change at all.
This is my simplest code:


.aspx
<telerik:RadGrid runat="server"  ID="RadGrid1" 
        OnNeedDataSource="RadGrid1_NeedDataSource" 
        AutoGenerateColumns="false" 
        AllowAutomaticUpdates="false" 
         > 
        <MasterTableView EditMode="InPlace"
            <Columns> 
                <telerik:GridBoundColumn DataField="Id"/> 
                <telerik:GridBoundColumn DataField="Name"/> 
                <telerik:GridEditCommandColumn /> 
            </Columns> 
        </MasterTableView> 
    </telerik:RadGrid> 

.aspx.cs

class Entity{ 
        private int _id; 
        public int Id { 
            get { return _id; } 
            set { _id = value; } 
        } 
 
        private string _name; 
        public string Name{ 
            get { return _name; } 
            set { _name = value; } 
        } 
    } 
 
    public partial class _Default : System.Web.UI.Page 
    { 
        private List<Entity> _list = new List<Entity>(){  
                new Entity(){ Id=1, Name="A Name" },  
                new Entity(){ Id=2, Name="Another Name" }, 
                new Entity(){ Id=3, Name="Pacman"
            }; 
 
        protected void Page_Load(object sender, EventArgs e){ } 
 
        protected void RadGrid1_NeedDataSource(object source,  Telerik.Web.UI.GridNeedDataSourceEventArgs e) 
        { 
            RadGrid1.DataSource = _list; 
        } 
    } 


Any suggestions?

Regards
Radoslav
Telerik team
 answered on 26 May 2010
6 answers
88 views
Hello,

I created my first skin for RadUpload (Q2 2009), and i put them in my App_Theme folder as follow:

App_Themes
- Green
- - Upload
- - - logo.gif
- - - ruProgress.gif
- - - ruSprite.png
- - Upload.css
- - Upload.Grn.css
and set the properties of the control in the page to (besides setting the theme of the page)

<telerik:RadUpload ID="radUploader" Localization-Select="Select File" runat="server" Skin="Grn" EnableEmbeddedSkins="false"  EnableEmbeddedBaseStylesheet="false"  EnableFileInputSkinning="true" ControlObjectsVisibility="none" 
                                ReadOnlyFileInputs="true" MaxFileInputsCount="5" > 
                                <Localization Select="Select File" /> 
</telerik:RadUpload> 

I increased the width of the font of the button and hence the width of the button too,
when i ran the page, i got the font bigger and the sprite image is used properly, but the problem with the width, when i traced the style used i found that my theme styles were included but they were overridden by the embedded styles!!!! even that i disabled them.

can you help please?

P.S. i cannot remove the Telerik_StyleSheet links, since there are other styles for other telerik controls that i still need them.
P.S2 if needed I can attach the CSS files and a screen shot.





Basel Nimer
Top achievements
Rank 2
 answered on 26 May 2010
1 answer
552 views
I have two radgrids on a form with autogeneratecolumns turned off viewstate turned on I am also using the needdatasource event.  The grid is being populated in the background via a datatable that is loaded from another method.  The data is loaded based on what value the user chooses from a drop down list.  When the value is selected the datatables are then populated and the grid is rebound.  I am calling the RadGrid.Rebind() method from within the drop down's selecteditemchanged method.

When a user tries to filter using the filter control or they try to sort a column they receive an error stating that "Cannot find column"  This error occurs for every column and in both grid boxes I have searched everywhere and cannot find a solution to this.  I have included some code snippets (both grids are pretty much exactly the same in code so I only included one grid) and the error stack trace.  I have double checked to make sure that the datasource column names match the sortexpression and the DataKeyField for each column.  I made sure not to call Databind from the Page_load leaving the grid binding up to needdatasource.  I am thinking that it might be caused by me calling rebind from the dropdown's selectedindex change method but how can I force the grids to rebind without calling the ReBind method since the needdatasource is not being triggered on postback.

Cannot find column Firstname.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IndexOutOfRangeException: Cannot find column Firstname.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[IndexOutOfRangeException: Cannot find column Firstname.]
   System.Data.DataTable.ParseSortString(String sortString) +4826462
   System.Data.DataView.CheckSort(String sort) +32
   System.Data.DataView.set_Sort(String value) +128
   Telerik.Web.UI.GridEnumerableFromDataView.PerformTransformation() +5029
   Telerik.Web.UI.GridEnumerableFromDataView.TransformEnumerable() +41
   Telerik.Web.UI.GridTableView.GetEnumerator(Boolean useDataSource, GridEnumerableBase resolvedDataSource, ArrayList dataKeysArray) +171
   Telerik.Web.UI.GridTableView.CreateControlHierarchy(Boolean useDataSource) +861
   Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource) +786
   System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +57
   System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +114
   System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +31
   System.Web.UI.WebControls.DataBoundControl.PerformSelect() +142
   Telerik.Web.UI.GridTableView.PerformSelect() +38
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +73
   Telerik.Web.UI.GridTableView.DataBind() +353
   Telerik.Web.UI.GridSortCommandEventArgs.ExecuteCommand(Object source) +325
   Telerik.Web.UI.RadGrid.OnBubbleEvent(Object source, EventArgs e) +191
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   Telerik.Web.UI.GridItem.OnBubbleEvent(Object source, EventArgs e) +61
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   Telerik.Web.UI.GridItem.OnBubbleEvent(Object source, EventArgs e) +165
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +118
   System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +135
   System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565

            <telerik:RadGrid ID="TrkEmpGrid" runat="server" AutoGenerateColumns="False" GridLines="None" 
                OnNeedDataSource="TrkEmpGrid_NeedDataSource" AllowFilteringByColumn="True" AllowSorting="True">  
                <GroupingSettings CaseSensitive="false" /> 
                <MasterTableView DataKeyNames="EmployeeKey" Width="100%">  
                    <RowIndicatorColumn> 
                        <HeaderStyle Width="20px"></HeaderStyle> 
                    </RowIndicatorColumn> 
                    <ExpandCollapseColumn> 
                        <HeaderStyle Width="20px"></HeaderStyle> 
                    </ExpandCollapseColumn> 
                    <Columns> 
                        <telerik:GridBoundColumn DataField="EmployeeKey" DefaultInsertValue="" HeaderText="EmployeeKey" 
                            SortExpression="EmployeeKey" UniqueName="Employee_Key" DataType="System.Int32" 
                            ReadOnly="True" Visible="false">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="Lastname" DefaultInsertValue="" HeaderText="Lastname" 
                            SortExpression="Lastname" UniqueName="Lastname">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="Firstname" DefaultInsertValue="" HeaderText="Firstname" 
                            SortExpression="Firstname" UniqueName="Firstname">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="EmployeeID" DefaultInsertValue="" HeaderText="Employee ID" 
                            SortExpression="EmployeeID" UniqueName="EmployeeID">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="AssignedTracks" HeaderText="Tracks" ReadOnly="True" 
                            SortExpression="AssignedTracks" UniqueName="AssignedTracks">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="ShiftName" HeaderText="Shift" ReadOnly="True" 
                            SortExpression="ShiftName" UniqueName="ShiftName">  
                        </telerik:GridBoundColumn> 
                    </Columns> 
                </MasterTableView> 
            </telerik:RadGrid> 
        </div> 
Radoslav
Telerik team
 answered on 26 May 2010
1 answer
186 views
Hi there.

I added a new field to my entity not mapped to Database, when i displayed the field using RadGrid, i have no problem, i assigned the value and is displayed sucessfully, the problem is when i try to filter the value..., I'm created a combo box into the filter, but when the selectindex changed:

 

<telerik:RadScriptBlock ID="RadScriptBlock3" runat="server">

 

 

<script type="text/javascript">

 

 

function StatusIndexChanged(sender,args) {

 

 

var tableView=$find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");

 

tableView.filter(

"NivelAdecuacion",args.get_item().get_value(),"EqualTo");

 

}

 

</script>

 

 

</telerik:RadScriptBlock>

 


An error is throw: The member XXX.NivelAdecuacion not admit SQL Conversion.

I supose that is due to the field is not mapped into Database table, is an added field, can anybody tell me how to solve this, please...

Thanks in advance
Yavor
Telerik team
 answered on 26 May 2010
1 answer
113 views
Is there a way to hide the input area of the combbox box until the user clicks the dropdown toggle button?

I'm setting the  DropDownWidth="70px" which is fine, but I only want the dropdown button to show when the control is not in use.

Thanks,

Ken
Kalina
Telerik team
 answered on 26 May 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?