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

I need to set overflow: visible on a textbox but have found that the style is not being obeyed.

I modified a Telerik example page by adding a textbox to the page with the overflow property set:

<li>
      test : <input type="text" value="message" style="overflow:visible;width:20px" />
</li>

I have attached a screenshot of what I see.

I am using RadControls for ASP.NET AJAX Q3 2010 and I see the problem in IE8 and FireFox 3.6.

Any help is appreciated.
TheCroc
Top achievements
Rank 1
 answered on 10 Feb 2011
1 answer
123 views
I am using date range filter from this example

http://demos.telerik.com/aspnet-ajax/grid/examples/programming/filtertemplate/defaultcs.aspx it has 2  datepickers for From and To.

I want to add also regular filter or date picker fo this column too.Otherwise, how do i filter just the date not date range?
Just found this post
http://www.telerik.com/community/forums/aspnet-ajax/grid/filter-with-from-and-todate-for-datetime-colum-with-normal-datepicker-filter.aspx

Dont think it provides elegant solution


Thank

Alex
Iana Tsolova
Telerik team
 answered on 10 Feb 2011
1 answer
165 views
When using RadGrid's WebUserControl, the DataItem object becomes null when using an ObjectDataSource only to fill ListBox.

Scenario 1 Works - Calling DataSource = __ and DataBind() in Page_Load:

protected void Page_Load(object sender, EventArgs e)  
{
    lstItemCollection.DataSource = GetCityCollection();
    lstItemCollection.DataBind();
}
public IEnumerable<Customer> GetCityCollection()
{
    using (UowEntities uow = new UowEntities())
    {
        CustomerRepository cr = new CustomerRepository(uow);
        return cr.SelectAll().ToArray();
    }
}
<asp:ListBox ID="lstItemCollection" runat="server" SelectionMode="Multiple" 
    DataValueField="CustomerId" DataTextField="City"  />

Scenario 2 - DataItem object is null when needed if using ObjectDataSource to bind data to ListBox:

<asp:ListBox ID="lstItemCollection" runat="server" SelectionMode="Multiple" DataValueField="CustomerId" DataTextField="City" DataSourceID="odsCityCollection" />           
<asp:ObjectDataSource ID="odsCityCollection" runat="server" SelectMethod="GetCityCollection"
TypeName="LINQScratchPad.Web.CommonUserControls.CustomerControl" ></asp:ObjectDataSource>

The ObjectDataSource automatically calls the GetCityCollection() method and that is when the DataItem becomes null. Later in the page lifecycle it will have a value again until I force the ListBox to DataBind in attempt to see if I have a value to DataItem (or even access to a HiddenField for that matter!).  I want the CustomerId value to filter my query in the SelectMethod of the ObjectDataSource. **NOTE: this is a very simple example and not real-world as I have moved to a play project for testing to resolve the underlying issue of a null DataItem.** I added the PreRender event handlers to show I have access to the DataItem again after it had become null.

public partial class CustomerControl : System.Web.UI.UserControl
{
    private object _dataItem;
    public object DataItem
    {
        get { return this._dataItem; }
        set { this._dataItem = value; }
    
    protected void Page_Load(object sender, EventArgs e)  {  }

    public IEnumerable<Customer> GetCityCollection()
    {
        using (UowEntities uow = new UowEntities())
        {
            Customer foo = (Customer)DataItem; // Always null!
              
            // Will throw null reference exception here if uncommented
            //var bar = HiddenField1.Value; 
            CustomerRepository cr = new CustomerRepository(uow);
            return cr.SelectAll().ToArray();
        }
    }
      
    protected void Page_PreRender(object sender, EventArgs e)
    {
        Customer foo = (Customer)DataItem; // Has value here
        var bar = this.HiddenField1.Value; // Has value here
        lstItemCollection.DataBind(); // DataItem is now null again :(
    }
    protected override void OnPreRender(EventArgs e)
    {
        Customer foo = (Customer)DataItem; // Has value here
        var bar = this.HiddenField1.Value; // Has value here
        lstItemCollection.DataBind(); // DataItem is now null again :(
        base.OnPreRender(e);
    }
}

In watching the DataItem value throughout the page lifecycle process, this is what I observed:
Page_Load - DataItem has value.  {F10}
Sets my HiddenField value. {F10}
<asp:HiddenField Value='<%# Eval("CustomerId") %>'  ID="HiddenField1" runat="server" />
Sets my other two Binds. {F10}
<ol class="column1">
    <li>
        <asp:Label ID="lblFirstName" runat="server">First Name:</asp:Label>
        <asp:TextBox ID="txtFirstName" runat="server"  Text='<%# Bind("FirstName") %>' />
    </li>
    <li>
        <asp:Label ID="lblLastName" runat="server">Last Name: </asp:Label>
        <asp:TextBox ID="txtLastName" runat="server" Text='<%# Bind("LastName") %>' />
    </li>
</ol>
ObjectDataSource calls GetCityCollection() and now DataItem object is null.

After that when stepping into the PreRender the DataItem has a value again until calling ListBox.DataBind() where the ObjectDataSource steps into the GetCityCollection() method and DataItem is once again null.

Can anybody explain why DataItem becomes null please?  
Thanks in advance!!
-Carrie
Iana Tsolova
Telerik team
 answered on 10 Feb 2011
1 answer
120 views
hi
i have to disable editing a particular column in a radgrid how to do it (i.e)if i have five column in a grid i have to edit and update only 2 columns the other 3 should not be editable
Shinu
Top achievements
Rank 2
 answered on 10 Feb 2011
2 answers
135 views

I just wondered if there was a skin/CSS available to re-create something similar to the RadToolBar used on the Telerik demos site. It looks like it is a RadTabStrip but in fact is a RadToolBar; any help with re-creating something similar to this would be greatly appreciated! I have attached a screen shot of what I am referring to if I haven’t been that clear.

James
Top achievements
Rank 1
 answered on 10 Feb 2011
3 answers
113 views
I've searched and looked up on how to hide Expand/Collapse but seems to only work if you already have all the data.
there a way to do it with ServerOnDemand loading? 

If I try this http://www.telerik.com/help/aspnet/grid/grdhideexpandcollapseimageswhennorecords.html
All the expand/collapse buttons go away. I'm assuming because the grid doesn't know if the row has child items or not. I have a dataset with three tables loaded already, there a way to check to see if each row will have child items and then hide/show the expand?
Iana Tsolova
Telerik team
 answered on 10 Feb 2011
9 answers
475 views
As the title says my grid extends past the screen width....here is my Grid:
<telerik:RadGrid ID="RadGrid1" runat="server" Skin="Sunset" AllowSorting="true" ShowFooter="false">  
                        <ItemStyle Font-Size="11px" /> 
                        <MasterTableView> 
                            <RowIndicatorColumn> 
                                <HeaderStyle Width="20px"></HeaderStyle> 
                            </RowIndicatorColumn> 
                            <ExpandCollapseColumn> 
                                <HeaderStyle Width="20px"></HeaderStyle> 
                            </ExpandCollapseColumn> 
                        </MasterTableView> 
                        <ClientSettings AllowColumnHide="false">  
                            <Scrolling AllowScroll="true" UseStaticHeaders="True" ScrollHeight="450px" /> 
                            <Resizing AllowColumnResize="true" ClipCellContentOnResize="true" 
                                   /> 
                        </ClientSettings> 
                    </telerik:RadGrid> 
When the grid loads with data it stretches past the screen width.  What I want it to do is add  a scroll bar to the bottom of the grid and allow you to scroll left or right without going off the right side of the screen.  Kind of like how you can scroll up and down within the grid with the side scroll bar....that works as inteded.

I also set the initial size of my columns programmatically in the ColumnCreated event:
    Protected Sub RadGrid1_ColumnCreated(ByVal sender As ObjectByVal e As Telerik.Web.UI.GridColumnCreatedEventArgs) Handles RadGrid1.ColumnCreated  
 
        Dim name As String = e.Column.UniqueName  
 
        'resize columns  
        If name = "Name" Or name = "Address1" Or name = "RFI Email" Or name = "Personal Email" Or name = "Practice" Then 
            Dim boundColumn As GridBoundColumn = CType(e.Column, GridBoundColumn)  
            boundColumn.ItemStyle.Width = 150  
            boundColumn.HeaderStyle.Width = 150  
        End If 
        If name = "Initials" Or name = "State" Then 
            Dim boundColumn As GridBoundColumn = CType(e.Column, GridBoundColumn)  
            boundColumn.ItemStyle.Width = 45  
            boundColumn.HeaderStyle.Width = 45  
        End If 
        If name = "Office" Then 
            Dim boundColumn As GridBoundColumn = CType(e.Column, GridBoundColumn)  
            boundColumn.ItemStyle.Width = 80  
            boundColumn.HeaderStyle.Width = 80  
        End If 
        If name = "Ext" Or name = "Zip" Then 
            Dim boundColumn As GridBoundColumn = CType(e.Column, GridBoundColumn)  
            boundColumn.ItemStyle.Width = 50  
            boundColumn.HeaderStyle.Width = 50  
        End If 
        If name = "Cell" Or name = "Home" Or name = "Fax" Or name = "Business" Or name = "City" Then 
            Dim boundColumn As GridBoundColumn = CType(e.Column, GridBoundColumn)  
            boundColumn.ItemStyle.Width = 89  
            boundColumn.HeaderStyle.Width = 89  
        End If 
        If name = "Address2" Then 
            Dim boundColumn As GridBoundColumn = CType(e.Column, GridBoundColumn)  
            boundColumn.ItemStyle.Width = 70  
            boundColumn.HeaderStyle.Width = 70  
        End If 
        If name = "Preferred" Then 
            Dim boundColumn As GridBoundColumn = CType(e.Column, GridBoundColumn)  
            boundColumn.ItemStyle.Width = 95  
            boundColumn.HeaderStyle.Width = 95  
        End If 
 
    End Sub 

Any help is appreciated.
thanks,

Coty
Pavlina
Telerik team
 answered on 10 Feb 2011
4 answers
129 views
We have a RadGrid with an EditFormType of WebUserControl.

The problem is that the DataItem property is set to the correct element only on first selection. If, on save, validation error occurs and the form is redisplayed, the value passed to the DataItem is null.

What can we do wrong? Is there something specific to set to always get the correct element on each "postback"?

Thanks,

Hugues
Iana Tsolova
Telerik team
 answered on 10 Feb 2011
11 answers
177 views
Hello,
I have a problem with collapsing radgrid items, when they're set to edit mode.

protected void Page_Load(object sender, EventArgs e)
{
 
      for (int i = 0; i < radGrid.PageSize; i++)
        {           
            for (int j = 0; j < radGrid.PageSize; j++)
            {
                radGrid.EditIndexes.Add(i, 0, j);
            }
        }
 
           
}

When I use javascript collapseItem() function, it's impossible to expand it later by user.

On the other hand, it's possible to collapse and expand items by user click - but again, not by running js onclick() method.

function CollapseAll() {
    var grid = $find("<%= radGrid.ClientID %>");
 
    master = grid.get_masterTableView();
 
    for (masterIndex = 0; masterIndex < master.get_dataItems().length; masterIndex++) {
 
            master.collapseItem(masterIndex);
    }

Any help would be appreciated.
Iana Tsolova
Telerik team
 answered on 10 Feb 2011
8 answers
157 views
Hello

I'm writing a test script that automates UI actions by accessing controls from the application under test using javascript/jquery. I load the test code which is a regular HTML page containing the test script into one frame and the application under test into another frame on the same page. Then I automate the UI action with something like this:
var completeBtn = $(parent.rightFrame.document).find("#completeButton");
completeBtn.click();
  
var genderSelect = $(parent.rightFrame.document).find("#genderDropDown");
genderSelect.val("F");
genderSelect.change();

I'm not familiar with the rad controls and I see that they are rendered completely different in the browser then the standard dropdowns. What do I need to do in order to select a value from the list items and fire the event that is usually triggered when a  user selects an item from the drop down menu? (I would like to do this without writing anything on the page of the actual application under test and without even seeing anything of that page besides for the source code of what's actually rendered in the browser.)

Thanx

Alan
Helen
Telerik team
 answered on 10 Feb 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
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?