.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

Binding to a grid row height, with splitter works until splitter is used.

Posted By:      Posted Date: October 11, 2010    Points: 0   Category :WPF

I hava a grid with two rows and a splitter, and it works fine.

I want the ability to show only one row(make the other one collapse), so I created binding between the second row height to a member in my view model.

When something happen(button click) I change the member value in my view model and the row disappear. on next click the row comes back and everything works fine.

The problem is that if I press button and use splitter, the binding stops working and on next clicks nothing happens.


I know I can write a specific ui side code that work without the binding, I prefer not to.

Help please.

View Complete Post

More Related Resource Links

File Splitter in .Net

I love to do utility programs in .Net. And this is one of them. As I was playing with JSplit (a free file splitter program), I wondered if I could do it in .Net. The framework supports file operations like reading files in bytes and creating them. It is indeed easy to do file operations in .Net Basics on File operations

Binding WPF grid to ViewModel : Suggest the design

I have structure like this I have following structure BaseViewModel ViewModel1: BaseviewModel ViewModel2: BaseViewModel In grid i will be showing the data from both the ViewModel1 and ViewModel2 (some common data is there ) How should i go about this Expected functionality : IF i select any row in the grid i should get respective ViewModel    

Workflow switch case activity splitter

Hi All, Can anyone advise, if the switch case activity accept case splitter?  If yes, how? Example: switch (number) Case 1, 5: Kindly advise.

Binding Grid to Excel Doc

I used the below code, and all i get is empty rows of data for each of the represented rows in my Excel doc. Am I doing something wrong?: private void btnUploadExcelToGrid_Click(object sender, RoutedEventArgs e) { string strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + fileSouce + ";Extended Properties=Excel 8.0;"; OleDbConnection conn = new OleDbConnection(strConn); OleDbDataAdapter da = new OleDbDataAdapter(); da.SelectCommand = new OleDbCommand("SELECT * FROM [Sheet1$]", conn); DataTable dt = new DataTable(); da.Fill(dt); dgExcel.DataContext = dt; } I do not have ACE installed on my dev box, and I am only using office 2k3, so Excel 8.0 made sense to me.  Here is a pic of what I get back: http://www.facebook.com/photo.php?pid=547091&l=32e9fb3745&id=1811331443  Charles Charles

Setting the canvas height and width to Grid size


I have a canvas and I have it set to the following attributes


 Grid.Row="1" Grid.RowSpan="2" Grid.Column="0" Grid.ColumnSpan="2"


However I want the canvas height and width to fill those locations. Also upon window resize i want the canvas height and width to adjust accordingly.

Any ideas? Thanks all

CSV splitter does not work on strings with commas {NOT RESOLVED}


hi friends,

i have extracted this from a previouse post http://social.msdn.microsoft.com/Forums/en-US/transactsql/thread/e9a031da-9578-4c30-8b6e-a2de29c9534a and ramireddy has give a fucntion to split multi line and multi column csv values:

declare @str nvarchar(max)

set @str = '100, what type, T, 1

	101, what kind, F, 1

	102, wheres at, T, 1

	103, what size, T, 1'


select ColValue,t.pos as Line,t1.ColumnNo from fn_split(@str,CHAR(10)) t

cross apply (select LTRIM(rtrim(Element)) as ColValue,pos as ColumnNo from fn_split(Element,','))t1	

CREATE FUNCTION [dbo].[fn_sp

Binding a scrollviewer height


i'm using a stack of expanders to mimick an accordion control. I have an ItemsControl on the page with it's ItemsSource set to Screens. Here is some sample code for the ViewModel.

	internal class MainWindowViewModel
ObservableCollection<Expander> _screens = new ObservableCollection<Expander>();
public ObservableCollection<Expander> Screens { get { return _screens; } }

internal Dictionary<stringUserControl> AppScreens = new Dictionary<stringUserContr

Binding a Grid via WCF Data Services


Hello everybody,

i am trying to bind a grid to a database via the internet. I did this for years and every time i do it, i am looking for new ways to do it. So this time i will give WCF Data Services a chance. But wait... after the first "solutions" i tried i figured out that nothing changed the years. I seems to be not easy at all....

The Idea of binding a grid to a database is, that the user see's data, can filter, search and sort on each column. And because we don't know the amount of rows we need a way to only load "some" of the rows and refetch at a time. This is a minimum requirement for each grid. So this is the goal. This means in case of the internet, that the query must be transferred to the server and the server should only return the data that was requested. It also means, that the grid must fetch only "some" rows and refetch the rest of the rows when the user is scrolling down.

Can WCF Data Services do that? Can the grid of .NET do that? Can the Telerik Grid do that or any other grid? 

I tried some of the examples called "binding grid to wcf data services", but none of them could do it. Maybe someone has a simple solution for it? Or do i have to write that my own?

Thanks for your help ... regards




Can it be done? Delimited String Splitter TVF with Automatic Delimiter Recognition


The request for T-SQL scripts answers located in the following thread:


This thread is not for scripts, it is for discussion.


Kalman Toth, SQL Server & Business Intelligence Training; SQL 2008 GRAND SLAM

Delimited String Splitter Function with Unknown Delimiter/Rule


I am looking for the best T-SQL solution. Hints are just given for problem statement, they should not be used hard-wired in the solution algorithm. Spaces can be trimmed right & left, reduced to single space in middle. It can be assumed that the following ranges are distinquished [a-z], [A-Z], [0-9].  Lookup table support can be added as last resort.

Good luck and thanks.

DECLARE @Delimited TABLE (String nvarchar(256))

INSERT @Delimited VALUES                           

Getting multiple rows from oracle stored procedure and binding it to grid view



To  get this stuff you need to create a Ref Cursor to return recordset.

             create or replace PACKAGE Types AS

            TYPE cursor_type IS REF CURSOR;

            END Types;

Now create a stored procedure to return multiple rows .

           create or replace

           PROCEDURE getAllCity(p_recordset OUT types.cursor_type) AS


           OPEN p_recordset FOR


Problem with resizing images and padding them to squared images before binding them to grid



I am developing a web application in ASP.NET and C# using Visual Studio 2008. The application will among other thing store images into a database in the original format and in some resized formats. I have this method that takes an image as argument and returns an image with the specified size:

thumbnailmage = ResizeImage(originalImage, new Size(50,50));

The image returned is proportional to the original image with no side bigger than 50 pixels. E.g. if the originalImage has width 100 and height 200 the resized image has width 25 and height 50. This result is expected and wanted.

Now, to what I really want. I want to modify the ResizeImage method to return a squared thumbnail. I.e. in the originalImage example sizes above, the returned image should have width width and heigth both 50. Also, the image should not be stretched but padded with 12.5 pixels on the left and right side making the width 50. The image format I currently work with is gif with transparent background so the padded image parts should also be tansparent. Here is the code for ResizeImage, does anyone know how it could be modified?

  private static Image ResizeImage(Image imageToResize, Size size)
      int sourceWidth = imageToResize.Width;
      int sourceHeight = imageToResize.Height;


Binding WPF Controls to an Entity Data Model

In this interview, programming writer, McLean Schofield, demonstrates how to bind WPF controls to an entity data model, using Visual Studio 2010 Beta 1. You can also learn more in the topic: Walkthrough: Binding WPF Controls to an Entity Data Model.

Binding the multiple drop down boxes in GridView using JQuery in ASP.NET

Here is the code for binding the multiple drop down boxes in GridView using JQuery in ASP.NET

Building a grouping Grid with GridView and ASP.NET AJAX toolkit CollapsiblePanel

I've posted an update to this post to apply on demand loading of Details data using ASP.NET AJAX PageMethods. I'm demonstrating the usage if CollapsiblePanelExtender client events on the new post. Check it out.

I admit, Matt Berseth is really inspiring me! Few days ago I pass through 2 of his great posts:

.Surrounding your Data Table and Dialog Controls with ComponentArt Styled Panels
.Building a Grouping Grid with the ASP.NET 3.5 LinqDataSource and ListView Controls
The first one is pure design tips one which I used for making good presentation of my demo here. The 2nd post is actually the idea.

Binding WPF Controls to an Entity Data Model

In this interview, programming writer, McLean Schofield, demonstrates how to bind WPF controls to an entity data model, using Visual Studio 2010 Beta 1. You can also learn more in the topic: Walkthrough: Binding WPF Controls to an Entity Data Model.

jQuery grid view plugin

jqGridView is new, client-rich, XML-based, ajax grid plugin for jQuery library. jqGridView provides professional solution for representing and editing tabular data on the web. Carefully designed, with powerful script API, this editable DHTML grid is easy configurable with XML, and shows convincing results working with large amounts of data. jqGridView allows easy implementation of nice looking(managed through css). jqGridView is not platform-depending plug-in, it can be used with different web -programming platforms like: ASP .NET/ASP, PHP, JAVA, CGI scripts etc. jqGridView has hight bowser compatibility.
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