tirsdag 8. mars 2011

Litt om det jeg jobbet med siste mnd

Javascript Lib:

SharePoint komponenter:
  • No managed code!
  • Work directly against prod js files!
  • Async update 60 sec
  • 80++ columns
  • Up to 120 rows
  • Sync with external db


mandag 24. august 2009

More on Objectdatasource

First I needed to refresh. First hit got me here, with the answer. A simple call to GridView1.DataBind(); will cause the grid to refresh.

Then I need to handle exceptions. This is done by setting e.ExceptionHandled=true in a OnUpdated, OnDeleted etc func with the signature:
protected void OnUpdated(object sender, ObjectDataSourceStatusEventArgs e).

Then I needed to set whats the key to be passed into the DeleteMethod. This is done by setting the DataKeyNames on the grid

torsdag 20. august 2009

Using a ObjectDataSource that takes constructors

is simply done by creating the object in the OnObjectCreating event, thanks to this link.


 <asp:ObjectDataSource ID='ObjectDataSource1' runat='server' 

          SelectMethod='GetData' 

          TypeName='BLL' OnObjectCreating='ObjectDataSource1_ObjectCreating'>

</asp:ObjectDataSource>



protected void ObjectDataSource1_ObjectCreating(object sender, ObjectDataSourceEventArgs e)
{
BLL bll = new BLL("arg1",100);
e.ObjectInstance = bll;
}

onsdag 19. august 2009

Getting a property value from reflection

Needed to get a value of a property I don't know runtime. This is what I ended up with:

// get the property via reflection

var v = person.GetType().GetProperty("NameOfProperty");

v.GetValue(person, null).ToString();

Merge xml files with XDocument

Quick answer to this link at stackoverflow:
var MyDoc = XDocument.Load("File1.xml");
MyDoc.Root.Add(XDocument.Load("File2.xml").Root.Elements());

fredag 14. august 2009

RegEx - I don't need to learn it!

Thanks to this tool I can skip learning the regex syntax again. :-)

torsdag 13. august 2009

Object Copy Function

Well, I guess I knew, but still made a search on how I got the shallow copy when I needed a deep copy. I found this post explaining my options.