This is a migrated thread and some comments may be shown as answers.

Rad Grid Column Display Issue and Set Display Properties

4 Answers 196 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
gc_0620
Top achievements
Rank 1
gc_0620 asked on 21 Aug 2009, 09:25 PM
Folks.

1) Certain Rad Grid Columns back ground color changes:
I have a radgrid with 5 columns. I am using Skin="Default". But some columns Filter TextBox Background/Foregound Color are Yellow/Black.   But some columns Filter TextBox Background/Foregound Color are White/Black.  It is also happening to some columns TextBoxes in MasterTable when it is in Insert/Edit Mode. I would like to keep all columns Background/Foregound Color as White/Black.

  

 

2) Changing Screen resolution:

How to change the Screen resolution to 1024x768 only when I am within a Website using Telerik controls? Can this changes be done in a Master page so that changes reflects to all Content Pages?  We are building a local Web Intranet project for our employees (Internal Users).   I do not want to change users Screen resolution permanently Via Display Properties setting from Windows.

3)  Maximize the Page:
How to Maximize the Page (not Full Screen) after it opens? Can this be done also via Master Page?

Anyhelp or suggestions will be sincerely appreciated.

Thank you.

4 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 24 Aug 2009, 06:18 AM
Hi,

1) I tried with the Default Skin, the Filter textbox and edit mode Textboxes are showing White backcolor. I am not sure what is happening on your end. If it is not working for some columns I would suggest you to access the edit mode textbox and filter textbox in code behind and set desired color.

CS:
 
 protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 
    { 
        if (e.Item is GridFilteringItem) 
        { 
            GridFilteringItem filter = (GridFilteringItem)e.Item; 
            TextBox txtbx = (TextBox)filter["columnUniqueName"].Controls[0]; 
            txtbx.BackColor = System.Drawing.Color.White; 
          
        } 
        if((e.Item is GridEditFormItem)&&(e.Item.IsInEditMode)) 
        { 
            GridEditFormItem editItem = (GridEditFormItem)e.Item; 
            TextBox txtbx = (TextBox)editItem["columnUniqueName"].Controls[0]; 
            txtbx.BackColor = System.Drawing.Color.White; 
           
        } 
         
    } 


Regards
Princy
0
gc_0620
Top achievements
Rank 1
answered on 24 Aug 2009, 07:30 PM

Hi Princy,

Thanks for answering. Unfortunately the last 2 GridboundColumns (Address1 and City), Filter TextBox Background/Foregound Color are still Yellow/Black. The 1st 4 columns Filter TextBox Background/Foregound Color are  White/Black (thats what they supposed to be) .  Also I was able to change the Foreground Color of Address1 Column after item databound; but changing the background from Yellow to White is the problem.  Very Strange. I do not know what other choice I have. Anyway, appreciate your help.

_______
protected void RadGrid2_ItemDataBound(object sender, GridItemEventArgs e)

 

{

 

if (e.Item is GridFilteringItem)

 

{

 

GridFilteringItem filteringItem = e.Item as GridFilteringItem;

 

 

TextBox box = filteringItem["Address1"].Controls[0] as TextBox;

 

box.ForeColor = System.Drawing.

Color.OrangeRed; // This Works

 

 

 

 

 

box.BackColor = System.Drawing.

Color.White; // This still Does not work

 

 

 

 

 

}

}

_________

 

 

<telerik:RadGrid ID="RadGrid2" runat="server" AllowAutomaticDeletes="True"
            AllowAutomaticInserts="True" AllowAutomaticUpdates="True"
            AllowCustomPaging="True" AllowFilteringByColumn="True" AllowPaging="True"
            AllowSorting="True" AutoGenerateColumns="False" AutoGenerateDeleteColumn="True"
            AutoGenerateEditColumn="True" DataSourceID="SqlDataSource4" GridLines="None"
            onitemdatabound="RadGrid2_ItemDataBound">
<MasterTableView DataKeyNames="PersonTableID" DataSourceID="SqlDataSource4">
<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>

<ExpandCollapseColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
    <Columns>
        <telerik:GridBoundColumn DataField="PersonTableID" DataType="System.Int32"
            HeaderText="PersonTableID" ReadOnly="True" SortExpression="PersonTableID"
            UniqueName="PersonTableID">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="BadgeID" HeaderText="BadgeID"
            SortExpression="BadgeID" UniqueName="BadgeID">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="LastName" HeaderText="LastName"
            SortExpression="LastName" UniqueName="LastName">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="FirstName" HeaderText="FirstName"
            SortExpression="FirstName" UniqueName="FirstName">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Address1" HeaderText="Address1"
            SortExpression="Address1" UniqueName="Address1">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="City" HeaderText="City"
            SortExpression="City" UniqueName="City">
        </telerik:GridBoundColumn>
    </Columns>
</MasterTableView>
            <ClientSettings>
                <Selecting AllowRowSelect="True" />
            </ClientSettings>
        </telerik:RadGrid>


 

0
gc_0620
Top achievements
Rank 1
answered on 24 Aug 2009, 09:29 PM


Princy,

In my Project I am using the prototype from:

http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/templateformupdate/defaultcs.aspx

When I opened this Telerik demo in Edit Mode, Employee Nancy Davolio's following Text Boxes Background/Foregound Color are also  Yellow/Black.

  1. Home Phone 
  2. Birth Date 
  3. First name 
  4. Last Name

 

The other columns Text Boxes Backgorund/Foregoround color are White/Black. What could be causing this? Any Idea? I am using VS 2008 with RadControls for ASP.NET AJAX Q2 2009 NET35.

Thanks

 




0
Aman
Top achievements
Rank 1
answered on 17 Mar 2014, 07:15 PM
With the help of http://www.telerik.com/help/aspnet-ajax/grid-getting-familiar-with-client-side-api.html. I got the method, '.get_visible()'. The problem is resolved.

Thanks,
Tags
General Discussions
Asked by
gc_0620
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
gc_0620
Top achievements
Rank 1
Aman
Top achievements
Rank 1
Share this question
or