Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
118 views

Hello,

I am binding to an arraylist which contains object  items with properties 'name' and 'val', when I call DataBind, ComboBo items are successfully created, but I'am unable to select one of the items.
It's so trivial that I'm thinking I have an error somewhere else, here is my code:

It runs in the Page_Load event of my page, not other interaction after.
The radCombo is not ajaxified, no autopostback.

            ArrayList ar                    =   im.CategoryList;  
            RadComboCat.DataSource          =   ar;  
            RadComboCat.DataValueField      =   "val";  
            RadComboCat.DataTextField       =   "name";  
            RadComboCat.DataBind();  
            if ( catId == 0 )  
            {  
                RadComboCat.SelectedIndex   =   0;  
            }  
            else  
            {  
                string strCat               =   catId.ToString();  
                 
                Trace2.WriteLine( string.Format("[V]CRMImageEdit FillCatComboSelected FindItemByValue: [{0}], catId:{1}",strCat,catId),CrmImageTrace.Sw.Info);  
                RadComboBoxItem it          =   RadComboCat.Items.FindItemByValue(strCat);  
                  
                Trace2.WriteLine( string.Format("[V]CRMImageEdit FillCatComboSelected FindItemByValue found : {0}", it != null ),CrmImageTrace.Sw.Info);  
                if (it != null)  
                {  
                    it.Selected = true;  
                     
                    Trace2.WriteLine( string.Format("[V]CRMImageEdit FillCatCombo Selected Item: {0}, catId:{1}",it.Text,catId),CrmImageTrace.Sw.Info);  
                }  
            }  
 

Trace shows that the it.Selected= true instruction is executed, but when page is displayed, nothing is selected.
When I select from the UI, the value is well selected and I can store it ????
What could be the reason ?

(Hollidays I know....)

Thanks
CS

Rosi
Telerik team
 answered on 19 Aug 2008
1 answer
152 views
Hi,

The Font Names the telerik dll  providing is hardly 7. But my requirement is to have font names similar to that of MSWord. How to add custom font names to the fontname dropdown box. or else can you provide a dll which has many font names similar to that of MSWord.


Thanks
Srinivas
Rumen
Telerik team
 answered on 19 Aug 2008
3 answers
310 views
Hi,

I'm having a problem with edit button in the RadGrid. Everything works fine when I use a ButtonType of linkButton, but when I switch the Button type to ImageButton, I get the following error.

Invalid postback or callback argument.  Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page.  For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them.  If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.

I don't understand why everything works fine with a linkbutton but not with an imagebutton. Does some different event get fired with an ImageButton?

The aspx code is as follows:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="gridTest.aspx.cs" Inherits="<...our path here...>Presentation.Web.UI.InventoryManagement.gridTest" %> 
 
<%@ Register Assembly="RadGrid.Net2" Namespace="Telerik.WebControls" TagPrefix="rad" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml" > 
<head runat="server">  
    <title>Untitled Page</title> 
</head> 
<body> 
    <form id="form1" runat="server">  
    <div> 
        <rad:RadGrid ID="RadGrid1" runat="server" AllowAutomaticInserts="True" AllowAutomaticUpdates="True" 
            AutoGenerateColumns="False"   
EnableAJAX="True" GridLines="None" Skin="Outlook2007">  
            <ClientSettings> 
                <Selecting AllowRowSelect="True" /> 
            </ClientSettings> 
            <MasterTableView DataKeyNames="StaustOutcomeId" CommandItemDisplay="Bottom" EditMode="InPlace" > 
                <Columns> 
                <rad:GridButtonColumn CommandName="Edit" UniqueName="Edit" Text="Edit" ButtonType="ImageButton" 
                HeaderText="Edit">  
                </rad:GridButtonColumn> 
<rad:GridBoundColumn DataField="Outcome" HeaderText="Outcome" SortExpression="Outcome" 
                        UniqueName="Outcome">  
                    </rad:GridBoundColumn> 
                    <rad:GridBoundColumn DataField="Status" HeaderText="Status" SortExpression="Status" 
                        UniqueName="Status">  
                    </rad:GridBoundColumn> 
                    <rad:GridBoundColumn DataField="Description" HeaderText="Description" SortExpression="Description" 
                        UniqueName="Description">  
                    </rad:GridBoundColumn> 
                    <rad:GridCheckBoxColumn DataField="IsActive" DataType="System.Boolean" HeaderText="IsActive" 
                        SortExpression="IsActive" UniqueName="IsActive">  
                    </rad:GridCheckBoxColumn> 
                    <rad:GridBoundColumn DataField="SalesChannel" HeaderText="SalesChannel" SortExpression="SalesChannel" 
                        UniqueName="SalesChannel">  
                    </rad:GridBoundColumn> 
                    <rad:GridBoundColumn DataField="StaustOutcomeId" DataType="System.Int32" HeaderText="StaustOutcomeId" 
                        ReadOnly="True" SortExpression="StaustOutcomeId" UniqueName="StaustOutcomeId">  
                    </rad:GridBoundColumn> 
                </Columns> 
                <ExpandCollapseColumn Resizable="False" Visible="False">  
                    <HeaderStyle Width="20px" /> 
                </ExpandCollapseColumn> 
                <RowIndicatorColumn Visible="False">  
                    <HeaderStyle Width="20px" /> 
                </RowIndicatorColumn> 
                   
            </MasterTableView> 
        </rad:RadGrid> 
          
    </div> 
    </form> 
</body> 
</html> 
 


And the code behind is
using System;  
using System.Data;  
using System.Configuration;  
using System.Collections;  
using System.Web;  
using System.Web.Security;  
using System.Web.UI;  
using System.Web.UI.WebControls;  
using System.Web.UI.WebControls.WebParts;  
using System.Web.UI.HtmlControls;  
using System.Collections.Generic;  
 
namespace <...our path here...>.Presentation.Web.UI.InventoryManagement  
{  
    public partial class gridTest : System.Web.UI.Page  
    {  
        protected void Page_Load(object sender, EventArgs e)  
        {  
            List<StatusOtcm> lst = new List<StatusOtcm>(3);  
            for (int i=0; i<3; i++)  
                lst.Add(new StatusOtcm());  
 
            RadGrid1.DataSource = lst;  
            RadGrid1.DataBind();  
        }  
    }  
 
    class StatusOtcm  
    {  
        public string Description  
        {  
            get { return "some Description"; }  
 
        }  
        public string Outcome  
        {  
            get { return "OC"; }  
 
        }  
 
        public string Status  
        {  
            get { return "Complete"; }  
 
        }  
        public bool IsActive  
        {  
            get { return true; }  
 
        }  
        public string SalesChannel  
        {  
            get { return "P"; }  
 
        }  
        public int StaustOutcomeId  
        {  
            get { return 25;}  
 
        }  
    }  
}  
 


Any ideas?

Thanks,

Tom
Konstantin Petkov
Telerik team
 answered on 19 Aug 2008
0 answers
79 views
Hi all,
I've a error when I using RadCombobox.
My problem:
I' ve two Combobox on form. When the first Combobox submit() then the twice combobox binding data base on the first combobox value.

Everythings is OK, but when I config IIS with default document (Normal: http://localhost/ecommerce/default.aspx  after config: http://localhost/ecommerce/)
 And then I've error when I submit() the first combobox.
Please help me!
Trong
Top achievements
Rank 1
 asked on 19 Aug 2008
1 answer
51 views
Hi,

I would like to know if I can bind RAD grid with MOSS 2007 list as datasource.

If yes, can you help me provide me some resources which helps me in acheiveing the same.

Regards,
Steve.
Yavor
Telerik team
 answered on 19 Aug 2008
3 answers
183 views
I'm sure someone can quickly point me in the right direction, but I've been tearing my hair out (something I can ill afford to do).

I have a RadGrid with columns arranged
GridTemplateColumn\GridBoundColumn\GridBoundColumn\GridTemplateColumn
Column 1 has an ASP CheckBox, column 4 an ASP DropDownList.

If the checkbox is unchecked, the dropdown is disabled; checking enables the dropdown. That's all good.

I also have a RadContextMenu on the Grid. I would like to enable or disable the menu items dependent on the state of the checkbox. This would need to be client-side JavaScript, within the OnClientItemClicked event (that's where I inspect the Menu item to see what I need to do).

I haven't been able to find anything about how to access a control within a GridTemplateColumn (maybe I've just not been looking in the right place?). I can get at values if I add them to ClientDataKeyNames, but that's not appropriate.

I've managed a workaround using a hidden field, but I'd like the code to simply check the enabled state, for reliability reasons (checking the value of a certain field isn't quite as robust as I'd wish).

paul
Yavor
Telerik team
 answered on 19 Aug 2008
1 answer
94 views
Hi,

I have a RagGrid with many child grids at the same level and im trying to hide the child grid if it is empty but im running into problems identifying the empty grids

I have tried looking at prerender and detailtable databind then looking at the items in the grid where the item count is 0 then hiding based on this but the grids always have an item count of 0 they always hide the grid even when they have data in them

e.g.

     GridItem[] nestedViewItems = tableView.GetItems(GridItemType.NestedView);
     foreach (GridNestedViewItem nestedViewItem in nestedViewItems)
     {
       foreach (GridTableView nestedView in nestedViewItem.NestedTableViews)
       {
         if (nestedView.Items.Count == 0)
         {

         if (nestedView.Items.Count == 0)
         {
           nestedView.Visible  = false;

         }


Any Ideas?

Thanks in advance
Yavor
Telerik team
 answered on 19 Aug 2008
2 answers
141 views
I've just started incorporating RadGrid into my web application.
One of the problems i've incountered (as my previous datagrid exp. was limited to winforms) was that the status bar text does not correpond with the overall direction of the grid (although i've already noticed that i had to set the align in the ItemStyle of each column to right).
After a few interrogations of my own, i've noticed that you encapsulated the text of the status using a span with the style property - float:left.
Thus the status text ignores the overall style.
Is there anything i can do to fix it?
tnx for any reply...
Roy
Top achievements
Rank 1
 answered on 19 Aug 2008
1 answer
133 views
Hi,

How do I get the tabstrip object in Javascript?  I have a tabstrip on my usercontrol and I used $find function to find the object but it always return null.

Here's my code:

<

telerik:RadTabStrip ID="testTS" runat="server" Skin="Office2007">
<Tabs>
<telerik:RadTab runat="server" ID="tab1" Text="tab 1" />
</Tabs>
</
telerik:RadTabStrip>

...

var

testTS = $find( "<%=testTS.ClientID %>" );

Thank you.



vn
Top achievements
Rank 1
 answered on 19 Aug 2008
2 answers
275 views
I have a detail table that shows all the coaches associated with a team. The details table also has a 'delete' column where I can remove that coach from a team. In the grdTeamToCoach_ItemCommand, how do I get the value of the row that is clicked in the detail table (specifically the 'teamtocoachkey')?

Thanks!
Susan

<

MasterTableView Width="100%" DataKeyNames="TeamKey">

<DetailTables>

<telerik:GridTableView Width="100%" runat="server" Name="AssignedCoaches" DataKeyNames="TeamToCoachKey">

<ParentTableRelation>

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

</ParentTableRelation>

<Columns>

<telerik:GridBoundColumn DataField="CoachAndType"/>

<telerik:GridTemplateColumn HeaderText="Remove" ItemStyle-HorizontalAlign=center>

<ItemTemplate>

<asp:ImageButton CommandName="DeleteRecord" TabIndex=-1 id="ibDelete" imageUrl="../images/delete.png" CausesValidation="False" runat="server" />

</ItemTemplate>

</telerik:GridTemplateColumn>

<telerik:GridBoundColumn DataField="TeamToCoachKey" Visible="false"/>

</Columns>

</telerik:GridTableView>

</DetailTables>

<Columns>

<telerik:GridBoundColumn HeaderText="Team and # of Coaches" DataField="TeamAndCount" UniqueName="TeamToCoachKey"/>

<telerik:GridBoundColumn DataField="TeamKey" Visible="false"/>

</Columns>

</MasterTableView>

Susan
Top achievements
Rank 1
 answered on 18 Aug 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?