Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
85 views

I can't figure it out.  I have AllowFilteringByColumn set to true on the main grid, so I thought it was supposed to allow it for all underlying tables, but everytime I attempt filtering a details table, I get a blank screen.

Here's the code:
aspx:
<telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True"
        AllowPaging="True" AllowSorting="True" GridLines="None"
        ondetailtabledatabind="RadGrid1_DetailTableDataBind"
        onneeddatasource="RadGrid1_NeedDataSource" Skin="WebBlue">
       
        <MasterTableView AutoGenerateColumns="false" DataKeyNames="ProjNo">
            <DetailTables>
                <telerik:GridTableView runat="server" ShowFooter="True">
                    <RowIndicatorColumn>
                        <HeaderStyle Width="20px" />
                    </RowIndicatorColumn>
                    <ExpandCollapseColumn>
                        <HeaderStyle Width="20px" />
                    </ExpandCollapseColumn>
                </telerik:GridTableView>
            </DetailTables>
            <RowIndicatorColumn>
                <HeaderStyle Width="20px"></HeaderStyle>
            </RowIndicatorColumn>
            <ExpandCollapseColumn Visible="True">
                <HeaderStyle Width="20px"></HeaderStyle>
            </ExpandCollapseColumn>
            <Columns>
            <telerik:GridBoundColumn DataField="ProjNo" DataType="System.Int32"
            HeaderText="Project Number" ReadOnly="True" SortExpression="ProjNo"
            UniqueName="ProjNo">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="ProjectName" HeaderText="Project Name"
            SortExpression="ProjectName" UniqueName="ProjectName">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="DateCreated" DataType="System.DateTime"
            HeaderText="Date Created" SortExpression="DateCreated"
            UniqueName="DateCreated">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="ProjectStatus" HeaderText="Project Status"
            SortExpression="ProjectStatus" UniqueName="ProjectStatus">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="POCName" HeaderText="Point Of Contact"
            ReadOnly="True" SortExpression="POCName" UniqueName="POCName">
        </telerik:GridBoundColumn>
            </Columns>
        </MasterTableView>
        <ClientSettings>
            <Scrolling AllowScroll="True" UseStaticHeaders="True" />
        </ClientSettings>
        <FilterMenu EnableTheming="True" Skin="Vista">
            <CollapseAnimation Type="OutQuint" Duration="200">
            </CollapseAnimation>
        </FilterMenu>
       
    </telerik:RadGrid>

 

CODE BEHIND:

private string user = "jrpuser";
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
    {
        GridData gd = new GridData();
        RadGrid1.DataSource = gd.GetProjects(user);
    }
    protected void RadGrid1_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e)
    {
        GridData gd = new GridData();
        GridDataItem masterItem = (GridDataItem)e.DetailTableView.ParentItem;
        e.DetailTableView.DataSource = gd.GetProjectDetails(user, Convert.ToInt16(masterItem.GetDataKeyValue("ProjNo")));
    }

BUSINESS OBJECTS:

public DataTable GetProjects(string user)
        {
            SqlDataAdapter da = null;
            DataTable table = new DataTable();
            SqlConnection conn = null;
            SqlCommand cmd = null;
            string connection;
            piiConnection strcon = new piiConnection();
            try
            {
                connection = strcon.getConnection();
                conn = new SqlConnection(connection);
                cmd = new SqlCommand("spGetProjects", conn);
                cmd.CommandType = System.Data.CommandType.StoredProcedure;
                cmd.Parameters.Add(new SqlParameter("@User", user));
                da = new SqlDataAdapter(cmd);
                conn.Open();
                da.Fill(table);
            }
            finally
            {
                conn.Close();
            }
            return table;
        }
        public DataTable GetProjectDetails(string user, int id)
        {
            SqlDataAdapter da = null;
            DataTable table = new DataTable();
            SqlConnection conn = null;
            SqlCommand cmd = null;
            string connection;
            piiConnection strcon = new piiConnection();

            try
            {
                connection = strcon.getConnection();
                conn = new SqlConnection(connection);
                cmd = new SqlCommand("spGetProjectDetails", conn);
                cmd.CommandType = System.Data.CommandType.StoredProcedure;
                cmd.Parameters.Add(new SqlParameter("@User", user));
                cmd.Parameters.Add(new SqlParameter("@ProjNo", id));
                da = new SqlDataAdapter(cmd);
                conn.Open();
                da.Fill(table);
            }
            finally
            {
                conn.Close();
            }
            return table;
        } 

Yavor
Telerik team
 answered on 29 Sep 2008
1 answer
98 views
When I dynamically add a RadWindow it always shows scrollbars in the parent, even though there are no scrollbars in the parent when the RadWindow doesn't appear.

Here's my code:

                            RadWindow1 = new RadWindow();  
                            RadWindow1.KeepInScreenBounds = true;  
                            RadWindow1.Skin = "WebBlue";  
                            RadWindow1.VisibleOnPageLoad = true;  
                            RadWindow1.Modal = true;  
                            RadWindow1.ShowContentDuringLoad = false;  
                            RadWindow1.VisibleTitlebar = false;  
                            RadWindow1.VisibleStatusbar = false;  
                            this.Controls.Add(RadWindow1);  
 

I've tried setting an absolute Width and Height, but although that resizes the RadWindow correctly, the scrollbars are still in the parent.

How can I fix this so the RadWindow doesn't make any scrollbars appear in the parent if the parent doesn't already have them?

thanks,

Steve
Svetlina Anati
Telerik team
 answered on 29 Sep 2008
1 answer
92 views
I am using hirarchy grid in detail table i have check box when i select that check box i need to find all columns in that row. and i want to allow user to check only one record in Detail table records.

Thanks in advance
Princy
Top achievements
Rank 2
 answered on 29 Sep 2008
1 answer
150 views
Collapsing a node by clicking on the - icon causes an interesting behavior.  The node collapses, briefly (<sec) displays one of the nodes that was collapsed, and then fully collapses.

It is visually annoying.

This is a Q2 build tree embedded in an update panel to support AJAX.

This does not occur when running the simple live examples on my server.
Atanas Korchev
Telerik team
 answered on 29 Sep 2008
4 answers
688 views
I have found a need to show tabular data in a heirarcy like this example

http://extjs.com/deploy/dev/examples/tree/column-tree.html 

They have a tree and grid in 1 control without each child row having a column header. I see in telerik we can have hierarcy grids but they are not really the same as this. The feature of the "tree" that I would like to have is that you can drag drop between nodes and also right click for a context menu.

Any help getting something like the above link would be great.

Thanks
John
Sebastian
Telerik team
 answered on 29 Sep 2008
1 answer
308 views
Hello,

To improve page rendering performance on a page with alot of date/time input fields, I'm trying to dynamically replace standard input textboxes with raddate/timepickers as the textboxes are selected, however I'm having trouble setting the text inside the date/time pickers.  As soon as the picker gets focus it replaces the value in its textbox with whatever the selected datetime is.  I need the value to "stick" when the picker gets focus, even if it is not valid.

Here's the code I'm using right now:

<input type="text" onfocus="onTimeInputFocus(this);"/> 
 
<script type="text/javascript" language="javascript"
                var replacedElement = null
 
                function onTimeInputFocus(input) 
                { 
                    timepicker = getNinjaTimePickerObject(); 
                     
                    timepickerEl = getNinjaTimePickerElement(); 
                    if ( replacedElement ) 
                    { 
                        replacedElement.value = timepicker.get_textBox().value; 
                        timepickerEl.parentNode.replaceChild(replacedElement, timepickerEl); 
                    } 
                    else 
                    { 
                        timepickerEl.parentNode.removeChild(timepickerEl); 
                    } 
                    replacedElement = input.parentNode.replaceChild(timepickerEl, input); 
                     
                    timepicker.get_textBox().value = replacedElement.value; 
                    //setTimeout( "timepicker.get_textBox().focus();", 100 ); 
                } 
                 
                function getNinjaTimePickerElement() 
                { 
                    return document.getElementById("<%= NinjaTimePicker.ClientID %>"  + "_wrapper"); 
                } 
                 
                function getNinjaTimePickerObject() 
                { 
                    return $find("<%= NinjaTimePicker.ClientID %>"); 
                } 
</script> 


I know I can always parse the datetime represented in the textbox and then call set_selectedDate() on the picker, but I need to be able to set values with invalid formats as well, and it would be nice if I could rely on the parsing mechanism inside the picker.
Missing User
 answered on 29 Sep 2008
6 answers
162 views
Hi,

How can I open a window miximized, with TitleBar but showing only the close button?
I tried to set InitialBehavior=Maximize and Behavior=Close, but the window opens with normal size.

Regards,

Henrique
Georgi Tunev
Telerik team
 answered on 29 Sep 2008
1 answer
184 views
how do you display a loading gif for images that arent loaded yet?

http:/maximlrg.com/uomo

you will see why i need to do this...

thanks..

Jeff
Dimo
Telerik team
 answered on 29 Sep 2008
1 answer
97 views
i just looked at the demo that you guys have online but all of them required postback. i thoguth when you use ajax it doesn't refresh or reload the page? could you explain the process of the chart for me. if you go to infrgistics, i click on different chart, it doesn't require me to reload the page at all. i think you could do that but not sure how. please point me to the right direction. thanks.
Ves
Telerik team
 answered on 29 Sep 2008
0 answers
74 views

Hi there,

I have been trying to implement filter with default options in the filtermenu and noticed that as soon as I implement a handler for ItemCommand event like this :

protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)

{

if (e.CommandName == "Sort" || e.CommandName == "Filter")

doDataBind =

true;

}

Here "doDataBind" is a local boolean value that is needed for logic.to select data that is to be binded with the grid.

Due to this, as soon as I click on the filter icon, the postback filter action is triggered on the grid with command "equalto". Thus I am not able to select the command with which I need to filter the grid items. Is there a workaround for this?

Please note that when the handler for itemcommand is not implemented, the filters do work just fine.

Thanks,
Shashvat


shashvat
Top achievements
Rank 1
 asked on 29 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?