Devexpress get horizontal position of particular detail view row's scrollbar? - c#

I have a master view with many rows, each of these rows has a detail view. Therefore each detail view can have its own horizontal scrollbar.
I wish to iterate through each master-row, check if it is expanded (I have done this) but now I wish to grab the horizontal scroll position of the corresponding detail view per expanded row.
How is this achieved?
I thought it would be masterGridView.GetDetailView(i,0).LeftCoord
but this doesnt work because GetDetailView cant return LeftCoord.....
SOLVED:
GridView gv = (GridView)mainGridView.GetDetailView(i,0);
gv.LeftCoord

it seems then you were using the WinForms XtraGrid control. You can read more about the GetDetailView method here
You can also ping the DevExpress support team directly.
Thanks.

Related

Change column view DataGridView

The title may be a bit confusing, and I'll try my best in trying to explain my problem.
I have a horizontally scrollable datagridview and when I click a button on the menu bar, I want the datagridview to move the view to the specified column, while still having all columns still visible.
So For example I click on Fish, and then the datagridview should scroll/position itself to the first mention of Fish in the columns to show a section of the view all related to Fish, while still maintaining all other columns not related to Fish and viewable.
What I would like to know is, is the moving of the position of the view possible to do? I didn't know what to search up, and more or less the results of the search included re-ordering of the columns, which I do not want.
For a DataGridView with windows form --- give your cell to Particuler Id.
Like you want to assign a one column with Fish then
row.Cells["Name"].Value = Fish.Id;
and then on click event give focus to this id.
Note:- for a better solution post your question with your code.
thanks
Replace fish to your search text and try it.
List<DataGridViewColumn> Cols = dataGridView1.Columns.Cast<DataGridViewColumn>().Where(c => c.HeaderText.Contains("fish")).ToList();
if (Cols.Count > 0)
{
dataGridView1.FirstDisplayedScrollingColumnIndex = Cols[0].Index;
}
Above code will scroll down datagridview horizontally to show searched text in column names.

C# listview column number change on resize in SmallIcon view

First, I want to be clear : I'm not talking about the ListViewColumnHeader, there are pretty much help available about columns disposition, programmative resizing, auto resize, etc..
I deal with a listview in smallIcon view mode (picture), where items are listed on n columns automatically.
LVresults.View = System.Windows.Forms.View.SmallIcon;
The ListView adjust the number of columns depending on each item size and the size of the Listview itself.
But, if the user perform a resize, even a vertical one, the Listview put every items on an unique column (forever !). Did someone already have to deal with SmallIcon (and LargeIcon i presume) columns ? Can you help me fix this so the ListView adjust the number of column dynamically on resize ?
Ps : The user can change the View mode with the second right button but this view is one of the best.
call this on resize:
LVresults.ArrangeIcons(ListViewAlignment.SnapToGrid);

listview box not displaying data in details view

I googled this question in many forms but couldn't find an answer applicable to me also..
I have a list view box in windows forms application and in that I add some items in runtime like the code I shown below:
lvinfo.Items.Add("Script executed successfully in " + dbname + " database");
The same code I am using several times for updates of execution and this works fine when I give the view as list or something else...
And also I am not clearing these items at any point of time in my code..When I googled I could find the answers related to clearing items..
My problem is when I set view property as Details, the text/content in the list view box is not displayed..or it is hidden..
EDIT:
I tried
columnHeader1.AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent);
Any response would be really appreciated..
I guess it is because you haven't add any columns to your list view. In details view you should add at least one column to display your item.Try this before adding your items:
listView1.Columns.Add("myColumnHeader");
Have you created column headers for your ListView as the documentation states:
If your ListView control does not have any column headers specified
and you set the View property to View.Details, the ListView control
will not display any items. If your ListView control does not have any
column headers specified and you set the View property to View.Tile,
the ListView control will not display any subitems.
and
Although columns are only displayed in the details view, subitems
without column headers will not display in either the details view or
the tile view.
Theres also an example further down the page for setting up column headers

Flip View with a Table inside?

I am trying to figure out how to make a flip view that would have a table in it. Basically I want to have a table with information for that day. Then you can flip to the next day or previous day and a new table would load up.
I am not sure how to do this though in Xaml. I will eventually have a data source that will connect to this table and pull the right information up but first I need to figure out how to write the xaml to make the table inside a flip view.
I am not sure if I should be using "Grid" or "Grid Layout".
Edit
I tried both these controls but was not really sure how to get it to have a column format nor how to get it so the flip view thought that there was more than one table(so it would give the controls to get to the next table).
Edit2
This is what I am trying to achieve (more styled up later and x number of rows per section and no border lines)
The documentation for the Grid class shows how to add rows, columns etc. You can use Grid to do a layout with other elements placed in a few rows/columns. To use more than a few or to bind a collection - various ItemsControl classes are better - ListView & GridView are probably most common on Windows 8.

Display ASP.NET GridView inside a selected row in another GridView

I have been given a mockup that I do not know is possible to code in ASP.NET without being a real html and javascript wizard.
I want a GridView that when a row is selected, the selected row expands and below the selected row a panel of additional information is shown, which would also include another small GridView. The idea is this would all be in-line. So if the user selected row 4, then the additional information would appear below row 4 and then after the additional information the parent GridView would continue with row 5.
Ultimately I would want to do a multi-select type of set up, but first I need to figure out if this is even possible. Also, the solution must be 508 Compliant
The one solution I considered was using only one "column". Then I would put all my fields in the ItemTemplate, and my detail panel content in the EditItemTemplate and instead of selecting the row, set it to edit mode. The problem with this solution is I lose the functionality of multiple columns if I throw everything in one huge ItemTemplate.
Any and all suggestions or ideas are appreciated.
What you're describing would be best fulfilled with a ListView control. It takes a little more templating work to set up than a grid view, but you have much more control over it and you can emulate the look of a GridView. You would set your Selected Item template to contain another ListView (or GridView) thats bound to your detailed data.
I've done this using a gridview inside a ListView and using ajaxcontroltoolkit collapsible panel
Your parent list would be a listview that would have 2 table rows for each item, on the first row your parent column, on the second row use colspan and add a gridview wrapped on a collapsible panel

Categories

Resources