Hello Telerik team,
I used to have set of columns that have a MinWidth and MaxWidth set by designs. Resizing is allowed.
The MinSize is being used to set a default minimal width when shown initially
Once the control has been painted it should set the minimum width of the rows to Zero, so that the user can adjust the width to their own desire.
This is shown in the following code...
private bool _isFirstPaint = true;
private void MyGridViewContainer_Paint(object sender, PaintEventArgs e)
{
if (_isFirstPaint == true)
{
//after 1st draw, we reset the minimum column width so that the collumns can be resized by the user below the initial minimum width set by design.
foreach (GridViewColumn column in this.radGridView1.Columns)
{
column.MinWidth = 0 ;
}
this.Paint -= new PaintEventHandler(MyGridViewContainer_Paint
_isFirstPaint = false;
}
else
{
_isFirstPaint =
false;
}
}
The problem is that this used to work with the 2008Q2 version, but not with the above versions.
Since we now switched to 2008.3.1204 and just a little later to 2008.3.1321, this problem has arrisen.
Please let us know what to do to overcome this change in behaviour.
Kind regards,
Jack
We have a problem in our Windows Forms Application. (.net 3.5)
We have many gridviews in different forms but they have same datasource which is datatable. Datatable gets updated rapidly by socket messages in socket class. Then gridviews refresh automaticaly when datatable gets updated.
The problem is gridviews freeze and it also freezes application.
we tried many difference solutions but they didnt work.
Any suggestions?
Thank you...
This is the sample of our program...
-----------Program.cs--------------------------------------------
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Main());
}
------------------Main.cs--------------------------------------------------------------------------------
public partial class Main : Form
{
public Main()
{
InitializeComponent();
}
private void Main_Load(object sender, EventArgs e)
{
GridForm form1 = new GridForm ();
form1.MdiParent = this;
form1.Show();
}
}
----------------GridForm.cs-----------(DataGridView in this Form)-----------------------
public partial class GridForm : Form
{
public GridForm()
{
InitializeComponent();
}
DataView dv_datatable;
private void GridForm _Load(object sender, EventArgs e)
{
dv_ datatable = new DataView(Global.DT);
x_GridView.DataSource = dv_ datatable;
}
}
--------------Socketp.cs------------------------------------------------------------------------------------
public class Socketp
{
public Socketp ()
{
bwListener = new BackgroundWorker();
bwListener.WorkerSupportsCancellation = true;
bwListener.DoWork += new DoWorkEventHandler(bwListener_DoWork);
bwListener.RunWorkerAsync();
}
void bwListener_DoWork(object sender, DoWorkEventArgs e)
{
SubscribeServer();
}
public void SubscribeServer()
{
//Some Socket Codes
IPEndPoint ipe = new IPEndPoint//…
clientSocket = new Socket(ipe.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
clientSocket.Connect(ipe); networkStream = new NetworkStream(clientSocket);
…
//Some Socket Codes
while (clientSocket.Connected)
{
///SomeCodes
byte[] buffer = new byte[clientSocket.ReceiveBufferSize];
///SomeCodes
DataRow rowx = Global.DT.NewRow();
rowx ["ISLEM"] = fields[3];
Global.DT.Rows.Add(rowx);//DataGridView is updated auto...
}
}
}
Note : Form's DoubleBuffered attribute is true.