.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

How to determine when focus moves into a RowDetails panel in a DataGrid?

Posted By:      Posted Date: September 03, 2010    Points: 0   Category :WPF
Is there a recommended way of determining when focus moves from the selected row into the details panel and knowing which field the focus is on? I don't really want to wire up all the controls in the panel, so am looking for a better way - all suggestions appreciated:-)

View Complete Post

More Related Resource Links

How to set the border for a WPF DataGrid Row which is currently having the focus

Hi, I want to set the border for a DataGrid Row which is currently having the focus. But not the seleced row because when the Multi selection is enabled for the datagrid then there is a chance that multiple rows can be selected. I need a solution in XAML Thanks in advance! Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This will help other members to find the solution easily.

How to determine if a user control is contained by the update panel that triggered async postback

Does anyone know a simple way to determine if a user control is contained in an update panel that was triggered for async postback?At the moment, the only pseudo logic for this I can think of is?'Loop through the update panel controls on the page and find the one that is involved in the postback (isInPartialRendering)'Try to find the user control as a child of the update panel

WPFTtoolkit Datagrid Rowdetails



We set the  RowDetailsVisibilityMode="VisibleWhenSelected" so that when a user click on the row more information displayed based on the RowDetailsTemplate.

However, if a user keep the mouse left button down and move over each row, the details for each row are displayed. How could we disable that behaviour? We only need one row's details to be displayed at a time.

Another issuse we have is after showing the row details twice, there will be a space gap at the bottom of the datagrid? How could we make the datagrid to adjust itselft not to leave the big space? The space's height seems equal to the detailsview's template.


Sometimes focus moves to first tab in TabControl when closed a dialog in another app domain


Hi everyone,

I have a strange and challenging problem. I have a TabControl with two tabs. When second tab is shown, users could open a dialog with a mouse click. However, this dialog is in another app domain because of some reasons. When users close the dialog, sometimes the focus moves to the first tab, it causes that second tab is hidden and the first tab is shown.

Any help are highly appreciated.

Best regards,

Getting a Checkbox in a datagrid to check before RowDetails expand the row.



I am having trouble getting a checkbox in my datagrid to check in certain situations. The row details in my grid cause the row to expand when the row is selected. When no row is selected, or a row below the row just clicked was the selected row prior to the click, things work fine (the checkbox I clicked on gets toggled and the row expands to show its rowdetails). If a row above the row I am clicking was selected (and therefore expanded, showing its rowdetails) when that row collapses, my current row moves up (because the row above collapsed) and the current row expands. However, the checkbox in that row (in the column that I clicked on) does not get checked in this case. I suspect it's because it is no longer in the space where the click occurred (because it works if clicking this checkbox/row doesn't cause it to move up before expanding). Is there a way to get the checkbox click to happen before the row selection? I seem to recall properties on controls in the past that indicated whether they answered before or after their child controls (maybe that was forms) but I cannot find any such property to set on the WPF DataGrid. Any suggestions? Thanks.


Datagrid Link button within the Update panel events are not working



I have a datagrid with linkbutton within the datagrid.   When i click on link button there is no response.   I have tried in different ways like
1.   after data binding to the datagrid
2. AsyncPostBackTrigger ControlID="lnk1" EventName="Tick"

can any one please tell me How to fire the linkbutton

Thanks & Regards,

Setting focus on cell in datagrid after CollectionChanged event.




Having trouble setting the focus on a cell after the collection recieves a new row. This is my code:

 sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
			DataGridRowObjects<My_DataGridRow> oc = (DataGridRowObjects<My_DataGridRow>)sender;
 (e.Action == NotifyCollectionChangedAction.Add)
				//set focus to column 2 of the new row

				DataGridCell cell = my_datagrid.GetCell(e.NewStartingIndex, 2);
 (cell != null
				 DataGridCellInfo info = new
				 my_datagrid.CurrentCell = info;

Is there any event that fires after the CollectionChanged? My DataGridRow doesn't have a CellPresenter att this stage and GetCell fails. If I do the same with a button event instead, it works fine.

I just tried to add a dispatcher message instead but that did nothing:

Dispatcher.BeginInvoke(new Action(delegate()
  //set focus to column 2 of the new row
  DataGridCell c

Create Toggle button for View RowDetails in a DataGrid



How can I create a toggle button for view a rowdetail in a datagrid.

I don´t want it when user clicked over de row, only in one button inside the row.

How to determine which textbox has focus?



I am trying to set the color of a textbox that has focus to gray. How can I tell which textbox currently has the curser on it so when they click the change color button it will change the textbox that is focused. Something like this:

focusedtextbox.BackColor = Drawing.Color.LightGray



Returning Focus (Position) in Panel After PostBack


VWD 2008 Express.  Visual Basic.

I have a gridview control within a panel control.  The gridview can contain up to 128 rows.  The panel is 300px high and has a vertical scroll bar that allows me to scroll to the row I want to see or edit in my gridview.  When I click the "Edit" button on an item within my gridview, the page posts back and returns to panel scrolled all the way back to the top.  I have to then scroll back down to get to the item I want to edit in my gridview (which has correctly been placed in edit mode).  How can I make the panel return to its postion (or stay in its postion) after a postback without me having to manually scroll back down?  Thanks for the help.

Bringing SelectedItem Into Focus Using DataGrid Control

When using datagrid control of the silverlight control there is situation when datagrid control has lots of records and vertical scrolling of the datagrid control is visible and the selected item of the datagrid control is not in the view as the scrolling (vertical scrolling of the datagrid is visible due to large record). So it is important to give focus to the selected item of the datagrid control.In this post I will give you solution of this problem which many of you may have face.

How to format and update GridView and DataGrid rows using JQuery

The behavior described in this question is as expected. When you set text of a cell in grid, it directly affects HTML that is going to be rendered. When you set text value of a cell, it means that you are setting innerText of the cell. The column that GridView creates for command fields (Edit, Delete and Select) are a (anchor) or button elements. So you can see what will happen if you set text value in that cell. It will wipe out those link or button controls and replace them with simple text string.

Use Jquery with repeater, gridview, datagrid

Before we talk about jquery inside any itemtemplate (repeater, gridview, datagrid), we need to understand the basic use of jquery functions

ListBox tricky to set in a DataGrid/GridView

Listboxes are very tricky to set selected items in grid - there is no real nice way to do it. It would have been great if Microsoft included a property that accepts an array or comma separated values - or anything! But they only allow each item in the list to be selected individually. The way to do this in a grid is a bit messy, but it is fairly simple to implement. When a row is created (as per the event), select the items of the listbox as per the datagrid source data:

How to highlight datagrid or GridView row on mouse over?

This article will show how you can Ajax with GridView to display popup messages when mouse moves over certain column. In the demo project I have added first column as an image column with a help icon in it. This kind of implements a feature that if you want more information about the row you can move mouse over this icon, a asynchronous request is sent to server for data about that row and when call returns the returned message is show as a popup message.

Multiple Column Dropdownlist for the ASP.NET DataGrid

Based on my previous control "Multiple Column DropDownList for ASP.NET", I received many emails asking for the same control to be used in the DataGrid for web applications. Here we go.. This control can be used as the regular MS DropDownList in the DataGrid and also as a regular dropdownlist. It has all the properties, like DataTextField, DataValueField, DataSource, SelectedIndex etc. The download file contains the samples both in VB.NET and C#. In this sample, I have used the Northwind database of SQL Server.

Determine whether Forms Server is installed on a server

Check whether the Microsoft.Office.InfoPath.Server.dll and FormServer.aspx files are installed on the server.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend