Gridview ScrollViewer Issue

Hi,
So I have a gridview with some rectangles in it and I would like to manually scroll the gridview using the ScrollViewer.ChangeView method. So I trap on the right arrow key and then invoke the ChangeView method to scroll the gridview to a different
location. I notice if I slowly hit the key repeatedly then the horizontal offset is what I expect it to be based on the offset parameter I passed to the ChangeView method. However, if I hit the right arrow key quickly then the horizontal offsets are not what
they should be based on the parameter I passed. Is there any way I can fix this so that no matter how quickly I hit the key (or even if I hold it down) the horizontal offset of the ScrollViewer will consistently increase by the offset I
pass to ChangeView?
Thanks :-)
Here is my example ...
<Page
x:Class="ReorderTest.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:ReorderTest"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Canvas x:Name="canvas" Width="1920" Height="1080">
<GridView x:Name="gridView1" Width="1920" Height="1080" CanReorderItems="True" SelectionMode="Single" ScrollViewer.HorizontalScrollMode="Enabled" CanDragItems="True" AllowDrop="True">
<GridView.ItemContainerTransitions>
<TransitionCollection>
<RepositionThemeTransition/>
</TransitionCollection>
</GridView.ItemContainerTransitions>
</GridView>
</Canvas>
</Page>
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using System.Diagnostics;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
using Windows.UI.Xaml.Media.Imaging;
using Windows.UI.Xaml.Media.Animation;
using Windows.UI.Xaml.Shapes;
using Windows.System;
using Windows.UI.Core;
using WinRTXamlToolkit.Controls.Extensions;
// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
namespace ReorderTest
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class MainPage : Page
private ScrollViewer scrollViewer;
public MainPage()
this.InitializeComponent();
Window.Current.CoreWindow.KeyDown += CoreWindow_KeyDown;
SolidColorBrush greenBrush = new SolidColorBrush(Windows.UI.Colors.Green);
for (int i = 0; i < 60; i++)
Rectangle temp = new Rectangle();
temp.Height = 250;
temp.Width = 400;
temp.Fill = greenBrush;
gridView1.Items.Add(temp);
this.Loaded += MainPage_Loaded;
private void MainPage_Loaded(object sender, RoutedEventArgs e)
scrollViewer = gridView1.GetFirstDescendantOfType<ScrollViewer>(); // using WinRTXamlToolkit.Controls.Extensions;
private void CoreWindow_KeyDown(CoreWindow sender, KeyEventArgs args)
//Rects[1].Opacity = 0;
if (args.VirtualKey == VirtualKey.Right)
scrollViewer.ChangeView(scrollViewer.HorizontalOffset + 300, null, null);
Debug.WriteLine(scrollViewer.HorizontalOffset);

Hi duffybr,
Try something like I suggested you in the previous thread:https://social.msdn.microsoft.com/Forums/en-US/8e81da67-949a-4206-855e-1dad60299841/scrollviewerchangeview-not-working-on-my-vertically-scrolling-gridview?forum=winappswithcsharp
Does it not working?
--James
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • Issue with scroll viewer using itemswrapgrid in gridview?

    Hi,
    am developing a windows phone 8.1 app using C# and xaml.
    i need to wrap my gridviewitems vertically.
    I have 10 GridView items in my GridView am using the below code to wrap my gridview items,
    but am able to see only 6 items, the scrollviewer is not coming vertically even though there are some more items.
    (In the below code for reference i just added only one grid view item but i have 10 gridview items in my code ,
    for every gridview item the height and width are 175 and 175 respectively)
    <Page.Resources>
            <ItemsPanelTemplate x:Key="GridViewItemsPanel">
                <ItemsWrapGrid Orientation="Vertical" />
            </ItemsPanelTemplate>
        </Page.Resources>
     <GridView x:Name="landscapeGridview"  
                    HorizontalContentAlignment="Stretch"
                      HorizontalAlignment="Stretch"
                      VerticalAlignment="Stretch"
                      ItemClick="GridView_ItemClick"
                      IsItemClickEnabled="True" 
                      ItemsPanel="{StaticResource GridViewItemsPanel}"
                     ScrollViewer.HorizontalScrollMode="Disabled"
                     ScrollViewer.VerticalScrollMode="Enabled"
                     ScrollViewer.HorizontalScrollBarVisibility="Visible"
                     ScrollViewer.VerticalScrollBarVisibility="Auto"
                      Grid.Row="2" Padding="10,0,0,0">   
    <GridViewItem Height="175" Width="175" Margin="0,5,5,0">
                            <Border Height="165" Width="165"
                        Tag="Notes" Background="#DDECEF">
                                <Grid>
                                    <Image Source="Assets/.png" Margin="0,0,0,0"></Image>
                                    <Image Source="Assets/.png" Margin="0,20,20,0" HorizontalAlignment="Right"
                                       VerticalAlignment="Top" Height="40" Visibility="Collapsed"></Image>
                                    <StackPanel    Background="{StaticResource ListViewItemOverlayBackgroundThemeBrush}"  
                                                     VerticalAlignment="Bottom" Margin="0,0,0,0" Height="30"
    Orientation="Horizontal"
                                               >
                                        <TextBlock Text="" FontSize="20"
                                 Margin="50,0,0,0"
                                   HorizontalAlignment="Center" 
                                            RequestedTheme="Dark"
                                   ></TextBlock>
                                        <TextBlock x:Name="notescounttxtblk" VerticalAlignment="Center" Margin="30,0,0,10"
                                          FontSize="20"></TextBlock>
                                    </StackPanel>
                                </Grid>
                            </Border>
                        </GridViewItem>
    </GridView>
    How to get the scroll viewer to view all the items vertically?
    Any help please?

    Hi Santhosh,
    Per my understanding, this issue is related to container definition where you put your GridView control. In this case, it is the Grid container.
    First you can see a working sample,
    https://code.msdn.microsoft.com/windowsapps/ListViewSimple-d5fc27dd. See the scenario 1 in windows phone project, I can reproduce your issue by setting the height of RowDefinition to “auto” where the GridView control sitting in. You need to check the height
    and width property of the layout. See more information about layout in XAML.
    https://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh465337.aspx.
    You’ve not mentioned the definition of the Grid layout, I assume you need change the RowDefinition. If you don’t know how, please see details in above code sample.
    Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Gridview Border color issue in IE10

    Hi,
    I am facing an issue in IE10(Version: 10.0.9200.17116, Update Versions: 10.0.21 (KB2987107)).
    when I try to render a grid view, the borders of the cell are not in proper color.
    The grid view is applied black border for cells and text color of grid cell is Red and Yellow on alternate row. But the border color of the grid view cell gets mixed with the text color inside the cell  and applied black border.
    You can see my post on (http[:]//forums[dot]asp[dot]net/t/2024404.aspx)
    Please let me know a suitable solution for the issue.
    Regards,
    Salman

    Hi,
    I noticed that you're using IE10(Version: 10.0.9200.17116, Update Versions: 10.0.21 (KB2987107)).As Robear mentioned in the first reply, we recommend to install the latest update KB 3008923 for IE to have a best performance.
    Have you checked the application code with F12 developer tool, then change the user agent string below Internet Explorer 10 as a test?
    I've checked the link you posted in the asp.net forum, seems you're trying to delelop a web application in IE, I'm not a developer, but I found some useful links
    some guys recommend css instead of html and others point a direction of tables inheritance
    http://stackoverflow.com/questions/16803844/border-colours-in-ie10-incorrect-all-other-browsers-ok
    https://social.msdn.microsoft.com/forums/ie/en-us/c3797399-3571-48e8-8d09-b771a9665109/ie10-incompatible-on-table-border-design
    NOTE
    This
    response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you.
    Microsoft
    does not control these sites and has not tested any software or information found on these sites.
    Yolanda Zhu
    TechNet Community Support

  • How can I display a letter grade in my gridview after calculating percentage into a hidden field in Visual Studio?

    For school I am working on an app using C# in visual studio that allows a student to enter their name, the number of points they earned and the points possible. When they click a submit button, the grade percentage is calculated in a hidden field and then
    the percentage and letter grade should spit out into the gridview. THe issue I am having is trying to figure out how to translate within the if statements regarding the percentage amount equalling whatever letter grade, and then spit that letter grade out
    into the gridview. Here is the code I have so far:
            protected void btnSubmit_Click(object sender, EventArgs e)
                SqlStudent.Insert();
                hdnGradePercent.Value = (((int.Parse("txtPointsEarned.Text")) / (int.Parse("txt.PointsPoss.Text")) * 100)).ToString();
                if ((int.Parse(hdnGradePercent.Value) >= 0) & ((int.Parse(hdnGradePercent.Value) <= 59)))
    (this is where I am having trouble. I can't figure out how to get the letter grade and percent to spit out into the   gridview.)
                else if ((int.Parse(hdnGradePercent.Value) >= 60) & ((int.Parse(hdnGradePercent.Value) <= 69)))
                else if ((int.Parse(hdnGradePercent.Value) >= 70) & ((int.Parse(hdnGradePercent.Value) <= 79)))
                else if ((int.Parse(hdnGradePercent.Value) >= 80) & ((int.Parse(hdnGradePercent.Value) <= 89)))
                else if ((int.Parse(hdnGradePercent.Value) >= 90) & ((int.Parse(hdnGradePercent.Value) <= 100)))
    Any help would be greatly appreciated! I've been stuck on this for hours and I"m losing my mind!!

    Please post ASP.NET questions in the ASP.NET forums (http://forums.asp.net ).

  • Issue in rendering CustomToolpart to select data source for custom webpart..

    I have a custom webpart in which i have added a tool part.This toolpart should allow me to select any list in the sitecollection which would be displayed on the webpage on doing apply in the webpart properties.The dropdown list with all lists is coming fine.The
    grid is diplaying as well.But in the toolpart,not in the webpart. I cant seem to segregate the two.There is also a textbox in the  toolpart in which the entered text comes in the webpart.But the same approach is failing for the gridview.Please suggest
    what to do.
    Also,i am failing at making a separate category for the toolpart by specifying [category("List settings")]..Any suggestion as to what i'm doing wrong in that are welcome too.
    Here is my webpart class and toolpart class.
    using System;
    using System.ComponentModel;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using Microsoft.SharePoint;
    using Microsoft.SharePoint.WebControls;
    using Microsoft.SharePoint.WebPartPages;
    using System.Data;
    using Microsoft.SharePoint.Utilities;
    namespace BB.WorkSpaces.Common.WebParts.CustomList
    [ToolboxItemAttribute(false)]
    public class CustomList : Microsoft.SharePoint.WebPartPages.WebPart
    [Browsable(false),
    Category("List Settings"),
    Description("Text Property")]
    // Visual Studio might automatically update this path when you change the Visual Web Part project item.
    private const string _ascxPath = @"~/_CONTROLTEMPLATES/BB.WorkSpaces.Common.WebParts/CustomList/CustomListUserControl.ascx";
    public string ListName
    get
    return _listName;
    set
    _listName = value;
    string _listName;
    public string ListValue
    get
    return _listValue;
    set
    _listValue = value;
    string _listValue;
    public GridView Gv
    get { return gv; }
    set { gv = value; }
    GridView gv;
    protected override void Render(HtmlTextWriter writer)
    base.Render(writer);
    writer.Write(ListName);
    writer.Write("<br />");
    writer.Write(ListValue);
    writer.Write("<br />");
    writer.Write(Gv);
    public override ToolPart[] GetToolParts()
    ToolPart[] allToolParts = new ToolPart[3];
    WebPartToolPart standardToolParts = new WebPartToolPart();
    CustomPropertyToolPart customToolParts = new CustomPropertyToolPart();
    allToolParts[0] = standardToolParts;
    allToolParts[1] = customToolParts;
    allToolParts[2] = new CustomToolPart();
    return allToolParts;
    public class CustomToolPart : Microsoft.SharePoint.WebPartPages.ToolPart
    DropDownList ddl;
    TextBox tb;
    protected override void CreateChildControls()
    ddl = new DropDownList();
    ddl.ID = "ddl";
    // Simply getting the lists of the current web, and displaying them in the dropdown-list.
    SPListCollection lists = SPContext.Current.Web.Lists;
    foreach (SPList list in lists)
    ddl.Items.Add(list.Title);
    tb = new TextBox();
    tb.ID = "tb";
    Controls.Add(ddl);
    Controls.Add(tb);
    base.CreateChildControls();
    public override void ApplyChanges()
    CustomList wp = (CustomList)this.ParentToolPane.SelectedWebPart;
    wp.ListName = ddl.SelectedValue;
    wp.ListValue = tb.Text;
    SPSite site = SPContext.Current.Site;
    SPWeb web = site.RootWeb;
    SPList list = web.Lists[ddl.SelectedItem.Text];
    //SPListItemCollection slist = list.GetItems();
    GridView GV1 = new GridView();
    DataTable dt = list.Items.GetDataTable();
    GV1.DataSource = dt;
    GV1.DataBind();
    this.Controls.Add(GV1);

    Hi,
    According to your post, my understanding is that you have an issue about the custom web part.
    Per my knowledge, we should customize the EditorPart instead of the
    ToolPart to bind the lists to the dropdown list.
    There is a good article about customizing web part, you can refer to it.
    http://www.concurrency.com/blog/create-a-custom-web-part-for-sharepoint-2010/
    More reference:
    http://www.enjoysharepoint.com/Articles/Details/show-all-list-in-dropdown-list-using-visual-web-part-20676.aspx
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • Hyper-V 2012 R2, integration services issue on multiple VMs

    Hello,
    I came to you because we encounter a technical issue on one of our Hyper-V (2012 R2).
    Our backup (Veeam backup in last version) are still failing with error :
    Guest processing skipped (check guest OS VSS state and integration components version)
    After checking integration service states of those VMs on the Hyper-V, we get this result :
    Get-VM | ft Name, IntegrationServicesVersion
    Name                                                       
    IntegrationServicesVersion
    xxx-3REP-01                                                
    6.3.9600.16384
    xxx-ADMIN02
    xxx-BAK02                                                  
    6.3.9600.16384
    xxx-MAIL-01
    xxx-SCOM-01-1                                              
    6.3.9600.16384
    xxx-SQL02                                                  
    6.3.9600.16384
    xxx-VC-01                                                  
    6.3.9600.16384
    xxx-VD01
    xxx-VMM02
    xxx-VMM03
    xxx-WEB01
    Get-VMIntegrationService xxx-vmm02 | Select Name,OperationalStatus
    Name                                                       
    OperationalStatus
    Time Synchronization                                       
    {Ok}
    Heartbeat                                                         
      {Ok, Ok}
    Key-Value Pair Exchange                                  {LostCommunication}
    Shutdown                                                          
    {LostCommunication}
    VSS                                                       
                  {LostCommunication}
    Guest Service Interface                                     {LostCommunication}
    I already try to disable, then enable the operationalStatus :
    Disable-VMIntegrationService -VMName MyVM -Name VSS,Shutdown,"Key-Value Pair Exchange"
    Enable-VMIntegrationService -VMName MyVM -Name VSS,Shutdown,"Key-Value Pair Exchange"
    The status is OK, but If I retry my backup I have the same error.
    So, is there a way to reinstall integration service component without rebooting ?
    Many thanks for your help.

    On the Windows VMs that are not 2012 R2, insert the Integration media ISO, install it, and reboot.
    When all is done, run this:
    # Input:
    $HVHost = "YourHostHere"
    # Processing:
    $VMInfo = @()
    Get-VM -ComputerName $HVHost | where { $_.State -eq "Running" } | % {
    $Info = New-Object -TypeName psobject
    $Info | Add-Member "VMName" $_.Name
    $Info | Add-Member "IntegrationServicesVersion" $_.IntegrationServicesVersion
    $OS = Invoke-Command -ComputerName $_.Name { (Get-CimInstance Win32_OperatingSystem).version } -ErrorAction SilentlyContinue
    $Info | Add-Member "OSVersion" $OS
    $VMInfo += $Info
    # Output:
    $VMInfo | Out-GridView
    $VMInfo | FT -AutoSize
    $VMInfo | Export-Csv .\VMInfo.csv -NoTypeInformation
    Sam Boutros, Senior Consultant, Software Logic, KOP, PA http://superwidgets.wordpress.com (Please take a moment to Vote as Helpful and/or Mark as Answer, where applicable) _________________________________________________________________________________
    Powershell: Learn it before it's an emergency http://technet.microsoft.com/en-us/scriptcenter/powershell.aspx http://technet.microsoft.com/en-us/scriptcenter/dd793612.aspx

  • Horizontal scrolling doesn't work with ItemsStackPanel in ListView(GridView)

    Hi,
    In Win 8.1 App Store Project I have a ListView with fixed width and listen for ContainerContentChanging event because of performance issues.
    When ListView width is less than content width, horizontal scrolling doesn't work. If we change ItemsStackPanel to VirtualizingStackPanel, horizontal scrolling works fine. But ContainerContentChanging doesn't work with VirtualizingStackPanel.
    Is it possible to make horizontal scrolling work with ItemsStackPanel?
    Here simple example to reproduce this problem:
    <Page
    x:Class="App8.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:App8"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">
    <Page.Resources>
    <DataTemplate x:Key="ContinuousViewItemTemplate">
    <Border Width="800"
    Background="Green"
    Margin="10"
    Padding="5">
    <Border x:Name="root" Height="800" Background="{Binding}"/>
    </Border>
    </DataTemplate>
    <Style x:Key="ListViewStyle1" TargetType="ListView">
    <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Visible"/>
    <Setter Property="ScrollViewer.HorizontalScrollMode" Value="Enabled"/>
    <Setter Property="ItemTemplate" Value="{StaticResource ContinuousViewItemTemplate}"/>
    </Style>
    </Page.Resources>
    <Grid>
    <Grid.ColumnDefinitions>
    <ColumnDefinition Width="100"/>
    <ColumnDefinition Width="500"/>
    <ColumnDefinition/>
    <ColumnDefinition Width="500"/>
    <ColumnDefinition Width="100"/>
    </Grid.ColumnDefinitions>
    <ListView Style="{StaticResource ListViewStyle1}" Grid.Column="1">
    <SolidColorBrush Color="Red"/>
    <SolidColorBrush Color="Cyan"/>
    </ListView>
    <ListView Style="{StaticResource ListViewStyle1}" Grid.Column="3">
    <ListView.ItemsPanel>
    <ItemsPanelTemplate>
    <VirtualizingStackPanel/>
    </ItemsPanelTemplate>
    </ListView.ItemsPanel>
    <SolidColorBrush Color="Red"/>
    <SolidColorBrush Color="Cyan"/>
    </ListView>
    </Grid>
    </Page>

    Hi Mikhail Maksyuta,
    Welcome back!
    Yes, you are right! I have reproduced it on VS 2013 professional.
    I will report it as bug, Thanks for your valuable suggestions!
    If you have any other questions about this, please feel free let me know!
    Thanks again!
    Regards! 
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Custom Form - Anchoring issue

    Hello folks,
    i were designed a simple form, and the anchoring goin' wrong...
    on designer it's OK, but while running not,
    i even tried following link example, replacing panel with inheritance version one, but it also didn't worked...
    http://support.microsoft.com/kb/953934
    my code are here:
    using System.Windows.Forms;
    using HassanFaghihi.Tools.InteropServices;
    namespace HassanFaghihi.StatesInstitution.Forms.Templates.CartoonBlackAndWhite
    public partial class ButtonForm : Form
    public ButtonForm()
    InitializeComponent();
    namespace HassanFaghihi.StatesInstitution.Forms.Templates.CartoonBlackAndWhite
    partial class ButtonForm
    /// <summary>
    /// Required designer variable.
    /// </summary>
    private System.ComponentModel.IContainer components = null;
    /// <summary>
    /// Clean up any resources being used.
    /// </summary>
    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
    protected override void Dispose(bool disposing)
    if (disposing && (components != null))
    components.Dispose();
    base.Dispose(disposing);
    #region Windows Form Designer generated code
    /// <summary>
    /// Required method for Designer support - do not modify
    /// the contents of this method with the code editor.
    /// </summary>
    private void InitializeComponent()
    this.panelHeaderPadding = new ControlContainer();
    this.panelHeader = new ControlContainer();
    this.panelCloseButton = new ControlContainer();
    this.panelMain = new ControlContainer();
    this.panelButtonPlaceHolderPadding = new ControlContainer();
    this.panelButtonPlaceHolder = new ControlContainer();
    this.panelContentPlaceHolder = new ControlContainer();
    this.panelHeaderPadding.SuspendLayout();
    this.panelHeader.SuspendLayout();
    this.panelMain.SuspendLayout();
    this.panelButtonPlaceHolderPadding.SuspendLayout();
    this.SuspendLayout();
    // panelHeaderPadding
    this.panelHeaderPadding.Controls.Add(this.panelHeader);
    this.panelHeaderPadding.Dock = System.Windows.Forms.DockStyle.Top;
    this.panelHeaderPadding.Location = new System.Drawing.Point(0, 0);
    this.panelHeaderPadding.Name = "panelHeaderPadding";
    this.panelHeaderPadding.Padding = new System.Windows.Forms.Padding(4, 4, 4, 0);
    this.panelHeaderPadding.Size = new System.Drawing.Size(500, 34);
    this.panelHeaderPadding.TabIndex = 0;
    // panelHeader
    this.panelHeader.BackColor = System.Drawing.Color.White;
    this.panelHeader.Controls.Add(this.panelCloseButton);
    this.panelHeader.Dock = System.Windows.Forms.DockStyle.Fill;
    this.panelHeader.Location = new System.Drawing.Point(4, 4);
    this.panelHeader.Name = "panelHeader";
    this.panelHeader.Size = new System.Drawing.Size(492, 30);
    this.panelHeader.TabIndex = 0;
    this.panelHeader.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel5_MouseDown);
    // panelCloseButton
    this.panelCloseButton.BackgroundImage = global::HassanFaghihi.StatesInstitution.Forms.Properties.Resources.close;
    this.panelCloseButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
    this.panelCloseButton.Dock = System.Windows.Forms.DockStyle.Right;
    this.panelCloseButton.Location = new System.Drawing.Point(462, 0);
    this.panelCloseButton.Name = "panelCloseButton";
    this.panelCloseButton.Size = new System.Drawing.Size(30, 30);
    this.panelCloseButton.TabIndex = 0;
    this.panelCloseButton.MouseClick += new System.Windows.Forms.MouseEventHandler(this.panel4_MouseClick);
    // panelMain
    this.panelMain.Controls.Add(this.panelContentPlaceHolder);
    this.panelMain.Controls.Add(this.panelButtonPlaceHolderPadding);
    this.panelMain.Dock = System.Windows.Forms.DockStyle.Fill;
    this.panelMain.Location = new System.Drawing.Point(0, 34);
    this.panelMain.Name = "panelMain";
    this.panelMain.Padding = new System.Windows.Forms.Padding(4);
    this.panelMain.Size = new System.Drawing.Size(500, 266);
    this.panelMain.TabIndex = 0;
    // panelButtonPlaceHolderPadding
    this.panelButtonPlaceHolderPadding.Controls.Add(this.panelButtonPlaceHolder);
    this.panelButtonPlaceHolderPadding.Dock = System.Windows.Forms.DockStyle.Bottom;
    this.panelButtonPlaceHolderPadding.Location = new System.Drawing.Point(4, 229);
    this.panelButtonPlaceHolderPadding.Name = "panelButtonPlaceHolderPadding";
    this.panelButtonPlaceHolderPadding.Padding = new System.Windows.Forms.Padding(0, 4, 0, 0);
    this.panelButtonPlaceHolderPadding.Size = new System.Drawing.Size(492, 33);
    this.panelButtonPlaceHolderPadding.TabIndex = 1;
    // panelButtonPlaceHolder
    this.panelButtonPlaceHolder.BackColor = System.Drawing.Color.White;
    this.panelButtonPlaceHolder.Dock = System.Windows.Forms.DockStyle.Fill;
    this.panelButtonPlaceHolder.Location = new System.Drawing.Point(0, 4);
    this.panelButtonPlaceHolder.Name = "panelButtonPlaceHolder";
    this.panelButtonPlaceHolder.Size = new System.Drawing.Size(492, 29);
    this.panelButtonPlaceHolder.TabIndex = 0;
    // panelContentPlaceHolder
    this.panelContentPlaceHolder.BackColor = System.Drawing.Color.White;
    this.panelContentPlaceHolder.Dock = System.Windows.Forms.DockStyle.Fill;
    this.panelContentPlaceHolder.Location = new System.Drawing.Point(4, 4);
    this.panelContentPlaceHolder.Name = "panelContentPlaceHolder";
    this.panelContentPlaceHolder.Size = new System.Drawing.Size(492, 225);
    this.panelContentPlaceHolder.TabIndex = 0;
    // ButtonForm
    this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    this.BackColor = System.Drawing.Color.Black;
    this.ClientSize = new System.Drawing.Size(500, 300);
    this.Controls.Add(this.panelMain);
    this.Controls.Add(this.panelHeaderPadding);
    this.Font = new System.Drawing.Font("Tahoma", 8F);
    this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
    this.Name = "ButtonForm";
    this.Text = "Form1";
    this.panelHeaderPadding.ResumeLayout(false);
    this.panelHeader.ResumeLayout(false);
    this.panelMain.ResumeLayout(false);
    this.panelButtonPlaceHolderPadding.ResumeLayout(false);
    this.ResumeLayout(false);
    #endregion
    private ControlContainer panelHeaderPadding;
    private ControlContainer panelCloseButton;
    private ControlContainer panelMain;
    protected internal ControlContainer panelHeader;
    private ControlContainer panelButtonPlaceHolderPadding;
    protected internal ControlContainer panelContentPlaceHolder;
    protected internal ControlContainer panelButtonPlaceHolder;
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Windows.Forms;
    using HassanFaghihi.StatesInstitution.BusinessTier.Factory;
    using HassanFaghihi.StatesInstitution.BusinessTier.Model;
    using HassanFaghihi.StatesInstitution.Forms.Templates.CartoonBlackAndWhite;
    using HassanFaghihi.Tools.Extensions;
    using NHibernate.Util;
    namespace HassanFaghihi.StatesInstitution.Forms
    public partial class FindOwner : ButtonForm
    private readonly List<Owner> _owners;
    public Owner SelectedOwner { get; set; }
    public FindOwner()
    try
    _owners = new OwnerFactory().GetOwners();
    catch (Exception ex)
    MessageBox.Show(this,
    "Cannot access data at this time, Please try again.\nError Message: {0}".FormatString(ex.Message),
    "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
    InitializeComponent();
    SelectedOwner = null;
    public FindOwner(Owner owner) : this()
    SelectedOwner = owner;
    //TODO: Select Current Owner on GridView
    private void FindOwner_Load(object sender, EventArgs e)
    //IQueryable<Owner> owners = new OwnerFactory().GetOwnersQueryable();
    gridOwners.DataSource = _owners.ToList();
    private void btnSelect_Click(object sender, EventArgs e)
    Guid id = (Guid) gridOwners.CurrentRow.Cells[@"OwnerId"].Value;
    SelectedOwner = _owners.First(w => id.Equals(w.OwnerId));
    Close();
    private void btnCancel_Click(object sender, EventArgs e)
    Close();
    namespace HassanFaghihi.StatesInstitution.Forms
    partial class FindOwner
    /// <summary>
    /// Required designer variable.
    /// </summary>
    private System.ComponentModel.IContainer components = null;
    /// <summary>
    /// Clean up any resources being used.
    /// </summary>
    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
    protected override void Dispose(bool disposing)
    if (disposing && (components != null))
    components.Dispose();
    base.Dispose(disposing);
    #region Windows Form Designer generated code
    /// <summary>
    /// Required method for Designer support - do not modify
    /// the contents of this method with the code editor.
    /// </summary>
    private void InitializeComponent()
    Janus.Windows.GridEX.GridEXLayout gridOwners_DesignTimeLayout = new Janus.Windows.GridEX.GridEXLayout();
    System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FindOwner));
    this.gridOwners = new Janus.Windows.GridEX.GridEX();
    this.btnSelect = new System.Windows.Forms.Button();
    this.btnCancel = new System.Windows.Forms.Button();
    this.panelContentPlaceHolder.SuspendLayout();
    this.panelButtonPlaceHolder.SuspendLayout();
    ((System.ComponentModel.ISupportInitialize)(this.gridOwners)).BeginInit();
    this.SuspendLayout();
    // panelHeader
    this.panelHeader.Size = new System.Drawing.Size(393, 30);
    // panelContentPlaceHolder
    this.panelContentPlaceHolder.Controls.Add(this.gridOwners);
    this.panelContentPlaceHolder.Size = new System.Drawing.Size(393, 135);
    // panelButtonPlaceHolder
    this.panelButtonPlaceHolder.Controls.Add(this.btnCancel);
    this.panelButtonPlaceHolder.Controls.Add(this.btnSelect);
    this.panelButtonPlaceHolder.Size = new System.Drawing.Size(393, 29);
    // gridOwners
    this.gridOwners.AlternatingRowFormatStyle.BackColor = System.Drawing.Color.Gainsboro;
    gridOwners_DesignTimeLayout.LayoutString = resources.GetString("gridOwners_DesignTimeLayout.LayoutString");
    this.gridOwners.DesignTimeLayout = gridOwners_DesignTimeLayout;
    this.gridOwners.Dock = System.Windows.Forms.DockStyle.Fill;
    this.gridOwners.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
    this.gridOwners.GroupByBoxVisible = false;
    this.gridOwners.Location = new System.Drawing.Point(0, 0);
    this.gridOwners.Name = "gridOwners";
    this.gridOwners.Office2007ColorScheme = Janus.Windows.GridEX.Office2007ColorScheme.Custom;
    this.gridOwners.Office2007CustomColor = System.Drawing.Color.Black;
    this.gridOwners.RowHeaderContent = Janus.Windows.GridEX.RowHeaderContent.RowIndex;
    this.gridOwners.RowHeaders = Janus.Windows.GridEX.InheritableBoolean.True;
    this.gridOwners.Size = new System.Drawing.Size(393, 135);
    this.gridOwners.TabIndex = 0;
    this.gridOwners.VisualStyle = Janus.Windows.GridEX.VisualStyle.Office2007;
    // btnSelect
    this.btnSelect.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
    this.btnSelect.DialogResult = System.Windows.Forms.DialogResult.OK;
    this.btnSelect.Image = global::HassanFaghihi.StatesInstitution.Forms.Properties.Resources.green_ok_icon_16px;
    this.btnSelect.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
    this.btnSelect.Location = new System.Drawing.Point(315, 3);
    this.btnSelect.Name = "btnSelect";
    this.btnSelect.Size = new System.Drawing.Size(75, 23);
    this.btnSelect.TabIndex = 1;
    this.btnSelect.Text = "انتخاب";
    this.btnSelect.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
    this.btnSelect.UseVisualStyleBackColor = true;
    this.btnSelect.Click += new System.EventHandler(this.btnSelect_Click);
    // btnCancel
    this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
    this.btnCancel.Image = global::HassanFaghihi.StatesInstitution.Forms.Properties.Resources.red_cross_icon_16px;
    this.btnCancel.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
    this.btnCancel.Location = new System.Drawing.Point(3, 3);
    this.btnCancel.Name = "btnCancel";
    this.btnCancel.Size = new System.Drawing.Size(75, 23);
    this.btnCancel.TabIndex = 2;
    this.btnCancel.Text = "خروج";
    this.btnCancel.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
    this.btnCancel.UseVisualStyleBackColor = true;
    this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
    // FindOwner
    this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    this.ClientSize = new System.Drawing.Size(401, 210);
    this.Name = "FindOwner";
    this.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
    this.Text = "FindOwner";
    this.Load += new System.EventHandler(this.FindOwner_Load);
    this.panelContentPlaceHolder.ResumeLayout(false);
    this.panelButtonPlaceHolder.ResumeLayout(false);
    ((System.ComponentModel.ISupportInitialize)(this.gridOwners)).EndInit();
    this.ResumeLayout(false);
    #endregion
    private Janus.Windows.GridEX.GridEX gridOwners;
    private System.Windows.Forms.Button btnSelect;
    private System.Windows.Forms.Button btnCancel;
    and here is my custom panel, regarding the issue, noted by microsoft
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    namespace HassanFaghihi.StatesInstitution.Forms.Templates.CartoonBlackAndWhite
    public class ControlContainer:Panel
    protected override void OnSizeChanged(EventArgs e)
    if (this.Handle != null)
    this.BeginInvoke((MethodInvoker)delegate
    base.OnSizeChanged(e);

    Hi deadManN
    I can see that you have panels within panels and this is causing the issue. I can also see that you're using the multi layer panels to give you borders.
    I'm going to suggest that you modify the layout.
    Here's what your original ButtonForm.Designer.cs looked like after some minor tweaks to get rid of errors:
    using System.Drawing;
    namespace HassanFaghihi.StatesInstitution.Forms.Templates.CartoonBlackAndWhite
    partial class ButtonForm
    /// <summary>
    /// Required designer variable.
    /// </summary>
    private System.ComponentModel.IContainer components = null;
    /// <summary>
    /// Clean up any resources being used.
    /// </summary>
    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
    protected override void Dispose(bool disposing)
    if (disposing && (components != null))
    components.Dispose();
    base.Dispose(disposing);
    #region Windows Form Designer generated code
    /// <summary>
    /// Required method for Designer support - do not modify
    /// the contents of this method with the code editor.
    /// </summary>
    private void InitializeComponent()
    System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ButtonForm));
    this.panelHeaderPadding = new WindowsFormsApplication1.ControlContainer();
    this.panelHeader = new WindowsFormsApplication1.ControlContainer();
    this.panelCloseButton = new WindowsFormsApplication1.ControlContainer();
    this.panelMain = new WindowsFormsApplication1.ControlContainer();
    this.panelContentPlaceHolder = new WindowsFormsApplication1.ControlContainer();
    this.panelButtonPlaceHolderPadding = new WindowsFormsApplication1.ControlContainer();
    this.panelButtonPlaceHolder = new WindowsFormsApplication1.ControlContainer();
    this.panelHeaderPadding.SuspendLayout();
    this.panelHeader.SuspendLayout();
    this.panelMain.SuspendLayout();
    this.panelButtonPlaceHolderPadding.SuspendLayout();
    this.SuspendLayout();
    // panelHeaderPadding
    this.panelHeaderPadding.Controls.Add(this.panelHeader);
    this.panelHeaderPadding.Dock = System.Windows.Forms.DockStyle.Top;
    this.panelHeaderPadding.Location = new System.Drawing.Point(0, 0);
    this.panelHeaderPadding.Name = "panelHeaderPadding";
    this.panelHeaderPadding.Padding = new System.Windows.Forms.Padding(4, 4, 4, 0);
    this.panelHeaderPadding.Size = new System.Drawing.Size(500, 34);
    this.panelHeaderPadding.TabIndex = 0;
    // panelHeader
    this.panelHeader.BackColor = System.Drawing.Color.White;
    this.panelHeader.Controls.Add(this.panelCloseButton);
    this.panelHeader.Dock = System.Windows.Forms.DockStyle.Fill;
    this.panelHeader.Location = new System.Drawing.Point(4, 4);
    this.panelHeader.Name = "panelHeader";
    this.panelHeader.Size = new System.Drawing.Size(492, 30);
    this.panelHeader.TabIndex = 0;
    // panelCloseButton
    this.panelCloseButton.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panelCloseButton.BackgroundImage")));
    this.panelCloseButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
    this.panelCloseButton.Dock = System.Windows.Forms.DockStyle.Right;
    this.panelCloseButton.Location = new System.Drawing.Point(462, 0);
    this.panelCloseButton.Name = "panelCloseButton";
    this.panelCloseButton.Size = new System.Drawing.Size(30, 30);
    this.panelCloseButton.TabIndex = 0;
    this.panelCloseButton.Click += new System.EventHandler(this.panelCloseButton_Click);
    // panelMain
    this.panelMain.Controls.Add(this.panelContentPlaceHolder);
    this.panelMain.Controls.Add(this.panelButtonPlaceHolderPadding);
    this.panelMain.Dock = System.Windows.Forms.DockStyle.Fill;
    this.panelMain.Location = new System.Drawing.Point(0, 34);
    this.panelMain.Name = "panelMain";
    this.panelMain.Padding = new System.Windows.Forms.Padding(4);
    this.panelMain.Size = new System.Drawing.Size(500, 266);
    this.panelMain.TabIndex = 0;
    // panelContentPlaceHolder
    this.panelContentPlaceHolder.BackColor = System.Drawing.Color.White;
    this.panelContentPlaceHolder.Dock = System.Windows.Forms.DockStyle.Fill;
    this.panelContentPlaceHolder.Location = new System.Drawing.Point(4, 4);
    this.panelContentPlaceHolder.Name = "panelContentPlaceHolder";
    this.panelContentPlaceHolder.Size = new System.Drawing.Size(492, 225);
    this.panelContentPlaceHolder.TabIndex = 0;
    // panelButtonPlaceHolderPadding
    this.panelButtonPlaceHolderPadding.Controls.Add(this.panelButtonPlaceHolder);
    this.panelButtonPlaceHolderPadding.Dock = System.Windows.Forms.DockStyle.Bottom;
    this.panelButtonPlaceHolderPadding.Location = new System.Drawing.Point(4, 229);
    this.panelButtonPlaceHolderPadding.Name = "panelButtonPlaceHolderPadding";
    this.panelButtonPlaceHolderPadding.Padding = new System.Windows.Forms.Padding(0, 4, 0, 0);
    this.panelButtonPlaceHolderPadding.Size = new System.Drawing.Size(492, 33);
    this.panelButtonPlaceHolderPadding.TabIndex = 1;
    // panelButtonPlaceHolder
    this.panelButtonPlaceHolder.BackColor = System.Drawing.Color.White;
    this.panelButtonPlaceHolder.Dock = System.Windows.Forms.DockStyle.Fill;
    this.panelButtonPlaceHolder.Location = new System.Drawing.Point(0, 4);
    this.panelButtonPlaceHolder.Name = "panelButtonPlaceHolder";
    this.panelButtonPlaceHolder.Size = new System.Drawing.Size(492, 29);
    this.panelButtonPlaceHolder.TabIndex = 0;
    // ButtonForm
    this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    this.BackColor = System.Drawing.Color.Black;
    this.ClientSize = new System.Drawing.Size(500, 300);
    this.Controls.Add(this.panelMain);
    this.Controls.Add(this.panelHeaderPadding);
    this.Font = new System.Drawing.Font("Tahoma", 8F);
    this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
    this.Name = "ButtonForm";
    this.Text = "Form1";
    this.panelHeaderPadding.ResumeLayout(false);
    this.panelHeader.ResumeLayout(false);
    this.panelMain.ResumeLayout(false);
    this.panelButtonPlaceHolderPadding.ResumeLayout(false);
    this.ResumeLayout(false);
    #endregion
    private ControlContainer panelHeaderPadding;
    private ControlContainer panelCloseButton;
    private ControlContainer panelMain;
    protected internal ControlContainer panelHeader;
    private ControlContainer panelButtonPlaceHolderPadding;
    protected internal ControlContainer panelContentPlaceHolder;
    protected internal ControlContainer panelButtonPlaceHolder;
    ...and here's what it looks like after I modified it:
    using System.Drawing;
    namespace HassanFaghihi.StatesInstitution.Forms.Templates.CartoonBlackAndWhite
    partial class ButtonForm
    /// <summary>
    /// Required designer variable.
    /// </summary>
    private System.ComponentModel.IContainer components = null;
    /// <summary>
    /// Clean up any resources being used.
    /// </summary>
    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
    protected override void Dispose(bool disposing)
    if (disposing && (components != null))
    components.Dispose();
    base.Dispose(disposing);
    #region Windows Form Designer generated code
    /// <summary>
    /// Required method for Designer support - do not modify
    /// the contents of this method with the code editor.
    /// </summary>
    private void InitializeComponent()
    System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ButtonForm));
    this.panelTopBorder = new System.Windows.Forms.Panel();
    this.panelBottomBorder = new System.Windows.Forms.Panel();
    this.panelContentPlaceHolder = new WindowsFormsApplication1.ControlContainer();
    this.panelHeader = new WindowsFormsApplication1.ControlContainer();
    this.panelCloseButton = new WindowsFormsApplication1.ControlContainer();
    this.panelButtonPlaceHolder = new WindowsFormsApplication1.ControlContainer();
    this.panelHeader.SuspendLayout();
    this.SuspendLayout();
    // panelTopBorder
    this.panelTopBorder.Dock = System.Windows.Forms.DockStyle.Top;
    this.panelTopBorder.Location = new System.Drawing.Point(4, 34);
    this.panelTopBorder.Name = "panelTopBorder";
    this.panelTopBorder.Size = new System.Drawing.Size(492, 4);
    this.panelTopBorder.TabIndex = 1;
    // panelBottomBorder
    this.panelBottomBorder.Dock = System.Windows.Forms.DockStyle.Bottom;
    this.panelBottomBorder.Location = new System.Drawing.Point(4, 263);
    this.panelBottomBorder.Name = "panelBottomBorder";
    this.panelBottomBorder.Size = new System.Drawing.Size(492, 4);
    this.panelBottomBorder.TabIndex = 2;
    // panelContentPlaceHolder
    this.panelContentPlaceHolder.BackColor = System.Drawing.Color.White;
    this.panelContentPlaceHolder.Dock = System.Windows.Forms.DockStyle.Fill;
    this.panelContentPlaceHolder.Location = new System.Drawing.Point(4, 34);
    this.panelContentPlaceHolder.Name = "panelContentPlaceHolder";
    this.panelContentPlaceHolder.Size = new System.Drawing.Size(492, 233);
    this.panelContentPlaceHolder.TabIndex = 0;
    // panelHeader
    this.panelHeader.BackColor = System.Drawing.Color.White;
    this.panelHeader.Controls.Add(this.panelCloseButton);
    this.panelHeader.Dock = System.Windows.Forms.DockStyle.Top;
    this.panelHeader.Location = new System.Drawing.Point(4, 4);
    this.panelHeader.Name = "panelHeader";
    this.panelHeader.Size = new System.Drawing.Size(492, 30);
    this.panelHeader.TabIndex = 0;
    // panelCloseButton
    this.panelCloseButton.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panelCloseButton.BackgroundImage")));
    this.panelCloseButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
    this.panelCloseButton.Dock = System.Windows.Forms.DockStyle.Right;
    this.panelCloseButton.Location = new System.Drawing.Point(462, 0);
    this.panelCloseButton.Name = "panelCloseButton";
    this.panelCloseButton.Size = new System.Drawing.Size(30, 30);
    this.panelCloseButton.TabIndex = 0;
    this.panelCloseButton.Click += new System.EventHandler(this.panelCloseButton_Click);
    // panelButtonPlaceHolder
    this.panelButtonPlaceHolder.BackColor = System.Drawing.Color.White;
    this.panelButtonPlaceHolder.Dock = System.Windows.Forms.DockStyle.Bottom;
    this.panelButtonPlaceHolder.Location = new System.Drawing.Point(4, 267);
    this.panelButtonPlaceHolder.Name = "panelButtonPlaceHolder";
    this.panelButtonPlaceHolder.Size = new System.Drawing.Size(492, 29);
    this.panelButtonPlaceHolder.TabIndex = 0;
    // ButtonForm
    this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    this.BackColor = System.Drawing.Color.Black;
    this.ClientSize = new System.Drawing.Size(500, 300);
    this.Controls.Add(this.panelTopBorder);
    this.Controls.Add(this.panelBottomBorder);
    this.Controls.Add(this.panelContentPlaceHolder);
    this.Controls.Add(this.panelHeader);
    this.Controls.Add(this.panelButtonPlaceHolder);
    this.Font = new System.Drawing.Font("Tahoma", 8F);
    this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
    this.Name = "ButtonForm";
    this.Padding = new System.Windows.Forms.Padding(4);
    this.Text = "Form1";
    this.panelHeader.ResumeLayout(false);
    this.ResumeLayout(false);
    #endregion
    private ControlContainer panelCloseButton;
    protected internal ControlContainer panelHeader;
    protected internal ControlContainer panelContentPlaceHolder;
    protected internal ControlContainer panelButtonPlaceHolder;
    private System.Windows.Forms.Panel panelTopBorder;
    private System.Windows.Forms.Panel panelBottomBorder;
    I removed the padding panels and set the header and footer panels to dock top and dock bottom. I then set the forms padding to 4 so that you get your desired black border around the outside and added two 4 pixel high panels docked to top and bottom
    to give you the desired border between header, content and footer panels.
    Mick Doherty
    http://dotnetrix.co.uk
    http://glassui.codeplex.com

  • Odd Formatting Issue

    I have an asp application which inserts data into the database. Before the insert I use vbscript to search for any apostrophes and add a single quote to it to ensure Oracle doesn't view it as the end of the string. This works fine and the information shows up via a select statement in a gridview on the asp page. If I run a query in sqlplus it shows the quote formatted as Æ and if I use TOAD it shows as ¿. Through my asp application I run a different query and convert it to HTML and it prints like this ’. So, as you can see I have some issues. I'm just not sure where it's really going sour because the one query prints the data to the gridview on the asp page without a problem. I'm guessing it's an ASCII issue??
    This happens with text copied and pasted from MS Word...
    Thanks
    Zewbie

    string. This works fine and the information shows up
    via a select statement in a gridview on the asp page.Maybe not after all. What is the database character set, and what is the Windows code page and nls_lang setting used in the asp side?
    If I run a query in sqlplus it shows the quote
    formatted as Æ and if I use TOAD it shows as ¿.The first one could be from using "oem" code page 850 and forgetting to tell Oracle this through a proper nls_lang setting. 145 and 146 is æ and Æ, respectively, which matches code values from windows-1252 for "smart" single quotes.
    The second one, in Toad, is probably from the conversion of character sets per nls_lang setting, where a smart quote got translated to a replacement character (¿) since target/client character set does not define the Windows specific quotes. This was probably also due to a wrong nls_lang setting (the client char set part).
    Through my asp application I run a different query
    and convert it to HTML and it prints like this ’.Character U+2019 (right "smart" single-quote) in utf-8 form is E2 80 99. If wrongly treated as single-byte character code bytes, in e.g. Windows-1252 character set, this utf-8 encoded character can come out as ’ (E2 80 99).

  • Count word appearance and show in gridview

    Hello all, I am working on a project with multi tables. In one table the user selects one of 13 categories that they are uploading images to. Each category has a sub category. On the main page , I have a grid view for each category that list the subcategories.
    Much the way a classified ads would work, I want to be able to show the number of each image in the subcategories as in below.
    Name
    number
      of images
    Subcategory
    3
    Subcategory
    2
    Subcategory
    4
    Subcategory
    23
    Subcategory
    1
    Subcategory
    3
    Subcategory
    332
    Subcategory
    1
    Subcategory
    3
    Subcategory
    2
    Subcategory
    3
    I am using the count function in stored procedure that counts the number of images in subcategory entered
    select subcategory, count(*) as mycount from userinput group as subcategory.
    which gives me the count of each item under the subcategory listed by the user.
    I need to be able to take this count and show it next the  item name in the 13 tables that list the subcategories.
    So I am counting the entries from one table (datasource) and showing the number of entries in 13 different tables (GridViews) based on the name of the subcategory.
    this has to be done when the page loads so the usre will see the correct amount of images in the 13  grid views.
    Any ideas on how to do this??
    Thanks in advance.

    Hi Jasonpauthement,
    If I understand correctly, you want to display the categories and corresponding subcategories in the main table, then display the each subcategory and the corresponding count images in another 13 tables. If in this scenario, we can refer to the steps below
    to display another 13 tables:
    Drag a table with subcategory and the corresponding count images values to the design surface.
    Then use a list with the same dataset to contain the table.
    In Row Groups, Right-click the Details group to add a group grouped on subcategory.
    Then each subcategory and its corresponding count images values would be displayed in the list. If there are any misunderstanding, please elaborate the issue for further investigation.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Need data edit,update and delete in the gridview

    Hi friends,
    I am facing a common problem which everyone already faced but I need to know is there anything new comes with this issue?
    My problem is I want to Edit, Update and Delete data in gridview in multiple column. I can do the edit , update,cancel and delete but what I want is I dont want this button to perform this. I mean when I load data in gridview the data will show in edit mode
    and when I edit any dat, the update will occur instantly in the sql server database. 
    Is there anything new development comes? whatever it is if its ajax or java script or something else please give me detail.
    Thanks for reading my post.
    Regards

    Questions related to ASP.NET should be posted in the ASP.NET forums (http://forums.asp.net ).

  • I am trying to hide a column in a gridview but need access to the data in these fields.

    I have a gridview with columns that I want to hide but still need to access this data at the row level. What is the best way to achieve this? (Using Visual Studio 2013)

    OK - I posted the question then posted the answer. I tried to find the answer and discovered the question was asked a
    lot, and many had 30 or more posts on the question. Since I spent way to much time looking at forums/discussions and figuring it out, I thought that I should repost the question then answer it. Hopefully if someone stumbles on it it might save
    them some time.
    I tried setting column widths, setting columns to visible=false before a bind (and after a bind), CCS, TemplateFields etc etc. All had problems either in the display, paging or retrieving the data in the gridview events (RowCommand & RowDataBound).
    I am not saying the others won't work but this is the way I got it to work. As with most coding issues once you have the answer it looks pretty simple.  
    First of all forget about trying to hide columns - Use DataKeyNames in the GridView. 
    Here is what I am trying to do - Based on the data in the "hidden columns" in the row, I want to manipulate how the Grid will appear. (Buttons will or will not appear)
    SQL:
    Select [FruitID], [StuffDesc], [ActionAFlag], [ActionBFlag] from [Friut] ORDER BY [StuffDesc]
    ASPX:
          <asp:gridview id="Gridview1"  AllowPaging="True" runat="server" 
                        autogeneratecolumns="False"
                        onrowdatabound="GridView1_RowDataBound"  
                        onrowcommand="GridView1_RowCommand"
                        Datakeynames="FruitID, ActionAFlag, ActionBFlag">
              <Columns>
                  <asp:BoundField DataField="StuffDesc"  Headertext="Made up Stuff" />
                  <asp:ButtonField ButtonType="Button" CommandName="FireA" Text="Action A" />
                  <asp:ButtonField ButtonType="Button" CommandName="FireB" Text="Action B" />
              </Columns>
          </asp:gridview>
    ASPX.VB
    RowDataBound fires before each row is rendered to the Gridview. The data in ActionAFlag and ActionBFlag will determine which buttons show. If the data in field ActionAFlag is 1 then "Action A" button shows; if field ActionBFlag
    is 1 then "Action B" shows. First it checks to see that you are dealing with a DataRow, (not Headers or Footers). Note variable "rowcounter" [I could not figure out how to get the row number from GridviewrowEventsArgs so I fudged it by
    using a global variable and setting it to 0. Each time the page is rendered the Rowcount is automatically set to 0]
        Protected Sub GridView1_RowDataBound(ByVal Sender As Object, ByVal e As GridViewRowEventArgs)
            If e.Row.RowType = DataControlRowType.DataRow Then
                Dim AShow As String = Gridview1.DataKeys(rowcounter).Values("ActionAFlag").ToString
                Dim BShow As String = Gridview1.DataKeys(rowcounter).Values("ActionBFlag").ToString
                If  AShow <> "1" Then
                    e.Row.Cells(1).Text = " "
                    ' -- Blank Action A Button ---
                End If
                If BShow <> "1" Then
                    e.Row.Cells(2).Text = " "
                    ' -- Blank Action B Button ---
                End If
                rowcounter = rowcounter + 1
            End If
    RowCommand fires on page changes or if a button on a row is clicked. I want to capture the FruitID and execute the appropriate button action. Here I can get the Row Index
        Protected Sub GridView1_RowCommand(ByVal sender As Object, ByVal e As GridViewCommandEventArgs)
            If e.CommandName = "FireA" Or e.CommandName = "FireB" Then
                Dim index As Integer = Convert.ToInt32(e.CommandArgument)
                Dim FruitID As String = Gridview1.DataKeys(index).Values("FruitID").ToString
                If e.CommandName = "FireA" Then
                    MsgBox(" In FireA / FruitID = " + FruitID)
                Else
                    MsgBox(" In FireB /FruitID = " + FruitID)
                End If
            End If
        End Sub

  • BitmapImage cache issue

    On WIndows 8 RP, I create a BitmapImage with the Uri of a file on disk. The user has the ability to change the image file (using a picker which will replace the file on disk that is currently being used). The issue is that even when the BitmapImage is recreated,
    because the Uri is pointing to the same file, the new updated image is never loaded. The only way to get the new image to load is to close and reopen the app. Clearly there is a cache issue.
    I have two questions:
    1. Is the issue with the cache of the BitmapImage that I construct using the Uri? Or is the issue with the cache of the Image UIElement that is displayed using the BitmapImage I mentioned previously?
    2. It looks like I have far fewer options when dealing with BitmapImages on WinRT. I cannot do bi.BeginInit() or bi.CacheOption. All I can do is bi.CreateOptions = BitmapCreateOptions.IgnoreImageCache; ... but this does not help.
    Here is how I'm constructing my BitmapImage:
    BitmapImage bi = new BitmapImage();bi.CreateOptions = BitmapCreateOptions.IgnoreImageCache;bi.UriSource = new Uri(currentFile.Path, UriKind.Absolute);
    Here is how I'm setting the grid cell BitmapImage (which is binded to a UIElement Image):
    gridViewCellObject.tileImage = bi;
    Here is the code for the gridViewCellObject tileImage get/set
    public BitmapImage muteImage
    get { return _muteImage; }
    set
    _muteImage = value;
    // Call NotifyPropertyChanged when the source property
    // is updated.
    NotifyPropertyChanged("muteImage");
    Here is the XAML which binds the Image to tileImage:
    <Image Source="{Binding tileImage, Mode=OneWay}" Width="140" Height="140" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,10,0,0" Stretch="Fill"/>
    Any advice on how get around this caching?
    Bryan L. Keller

    Here is the solution. As the comments in my code suggest, this is ridiculous and shouldn't even be necessary.
    Here is the revised getPhotos method. I copy each bitmap from its original source to the temp folder. I give it a random name that will never be repeated while the application is open. This is done by getting some information about the current system time.
    I calculated it out to be a 1 in 10^-8 chance of getting a duplicate file name using my method of naming.
    public async Task<List<BitmapImage>> getPhotos()
    photos.Clear();
    IReadOnlyList<IStorageFile> files = (IReadOnlyList<IStorageFile>) await folderHierarchy.Last().GetFilesAsync(); //gets storagefiles of original png files
    DateTime currentTime;
    foreach (StorageFile currentFile in files)
    if (currentFile.Name.EndsWith(".png")) //get only png files
    //copy to and read from temp to prevent bitmap caching. (It's ridiculous that I even need to do this)
    currentTime = DateTime.Now;
    String tempFileName = currentTime.Hour + " " + currentTime.Minute + " " + currentTime.Second + " " + currentTime.Millisecond; //generate unique name
    await currentFile.CopyAsync(Windows.Storage.ApplicationData.Current.TemporaryFolder, tempFileName); //copy to temp with unique name
    //because the name is new each time, the bitmap will never be cached. photos.Add(new BitmapImage(new Uri((await Windows.Storage.ApplicationData.Current.TemporaryFolder.GetFileAsync(tempFileName)).Path))); //add bitmap to array of photos. This is used by the rest of the app to populate the gridview
    return photos; //return array of photos
    Microsoft, I shouldn't need to waste time solving your API issues. This stuff should have been fixed in one of the Developer Preview builds, NOT the Release preview.
    Get your act together so developers can do their job.
    Bryan L. Keller

  • Why filter causes multiple identical images in gridview to display in literoom 4.3?

    I have not been able to find why multiple identical images are displaying in gridview when filters are applied.  There is only one image in the folder.  This obviously makes it difficult to apply images to keywords.
    I simply can't find the reason.  Neither is there anything in help on this issue. 

    BenMarkus
    Third request for help regarding the problem detailed below.
    Mar 16, 2013 1:44 PM in reply to Community Help
    Report
    I am in the process of organizing my Literoom images and filter displays
    MULTIPLE IDENTICAL IMAGES, under METADATA STATUS changed. .
    Computer info - Literoom 4.3, windows 7, some 55,000 images on the hardrive, one
    catalog used.
    When I go to folders, and click on J drive which holds these images, they all
    come up if filter is off of course. Now using metadata I search on a date, a
    camera, lense, etc. But I just want to find all of my images on a particular
    day. I can find those with no problem. My problem is that I may have 2 or more
    identical images display in grid and view as well as film strip. Looking up
    metadate status I find that these images are CHANGED. I understand that status,
    but there is no way that these multiple images would result from my work.
    I searched for multiple files located in multiple folders - NOT THE CASE. What
    is creating those multiple files, they are identical as to date, how they look,
    etc?
    If I go to CATALOG, and work with the all the images there, found at the top of
    course, I get the same functionality, BUT THE MULTIPLE IMAGES ARE ABSENT.
    I can't find the reason for this in any help. I would appreciate very much some
    one telling me why this is takes place. It makes it difficult to keyword on
    images on a certain date, because of the multiple files.
    Filters are a powerful tool for organizing collections and keywords - my problem
    is not using filters, but understanding why multiple images.
    Further investigation this problem is found in any place - Catalog, or folder. 
    Believe me this is a PROBLEM.  I need to find a live person somewhere in the
    vast ocean of helps that can answer this question.  I don't have a problem
    understanding how to use it, I JUST WANT TO KNOW WHY MULTIPLE IMAGES.
    Can you or someone in Adobe answer my question.  I just want an answer.  Say I
    payed my money why can't it work properly.
    Ben Lamfers

  • Access the gridview of the grid control

    Hi all
    It may seem a weird title, but this is exactly my problem.
    I am using winforms with devexpress tool in my application. I want to access the selected row of a grid view from another form. so I used the following code:
    foreach (XtraUserControl usrControl in splitContainerControl.Panel2.Controls)
                    if (usrControl is MY_USER_CONTROL_NAME)
                        foreach (Control grid_control in usrControl.Controls)
                            if (grid_control is GridControl)
                                //up to this point i must be able to access the grid control, and after that access the grid
    view by using
                                //the following statement as I found in other forum
                                GridView myView = grid_control.ViewCollection[0] as GridView;
    the problem is I cannot get this ViewCollection[] property of the grid control
    any help???

    Hi khidir,
    As far as I know, devexpress is not a Microsoft product, thus the issue of devexpress you could go to the official site of devexpress for professional support.
    The link might be useful to you:
    #How to get field value of selected Row Devexpress GridView?
    http://stackoverflow.com/questions/19206186/how-to-get-field-value-of-selected-row-devexpress-gridview
    The official site of devexpress as below:
    https://www.devexpress.com/
    If you have any further questions, please feel free to post in this forum.
    Best Regards,
    Leo

Maybe you are looking for

  • How do I get InDesign to open on the second monitor of a two-monitor system?

    My computer is connected to two identical monitors. I use them in extended mode. Monitor 1 includes my WIndows desktop; Monitor 2 does not I want to open my InDesign files on "Monitor 2" which does NOT have impediments like a taskbar that wants to po

  • TYPING MESSAGES PROBLEM

    How do I stop the messages from being sent prematurely when I strick the Enter key while typing?  This happens when I touch Enter key by accident when I intended to touch the Shift Key to capitalize at letter at the begining of a sentence.

  • Mountain Lion: Connect To Old MySQL Data

    I'm trying to connect to my old MySQL databases after upgrading to 10.8. They are definitely on the computer. I can see them in the /usr/local/mysql folder. I can even connect to them using Sequel Pro, but I can't get PHP or Apache to work with it. A

  • Latest OS X nightmare

    Okay, i'm really trying to keep an open mind about OSX here, but i'm on the verge of going back to OS9. (and I've only found one thing i can't do in OS9 that i can do in OSX, and that's play h264). Anyway, the problem now is that some files aren't sh

  • Locking only a few apps?

    Is to lock only specific applications? Instead of locking the whole iPod touch, is it possible to only lock Mail, Contacts, and some apps store apps? I don't want to have to unlock the iPod every time I want to change songs, rewind 30s, change the vo