It took me a long time to find out how to go to a new page on telerik when clicking on a grid row. Here is a sample code in case an internet traveler stumbles upon it.
Html.Telerik().Grid(Model.dialogueEntity)
.DataKeys(keys => keys.Add(o => o.DialogueID))
.HtmlAttributes(new { style = "height: 100%; border: 0;" })
.Name("Grido")
.Selectable()
.Columns(columns =>
{
columns.Bound(o => o.DialogueID).Hidden();
columns.Bound(o => o.LoanID);
})
//.Scrollable()
//.Sortable(sorting => sorting.OrderBy(sortOrder => sortOrder.Add(o => o.LoanID).Ascending())
.Sortable(config => config
.OrderBy(order => order
.Add(((string)ViewData["view"]) == "sortedByDate" ? "Category Type" : "LoanID")
)
)
.ClientEvents(events => events.OnRowSelect("onRowSelect"))
.Filterable()
.Render();
The green text is needed for this to work
And this javascript part is needed to go to another page. o.DialogueID was the key that I was using to take the user to as explained below.
<script type="text/javascript">
function onRowSelect(e)
{
var id = e.row.cells[0].innerHTML;
location.href = "/Dialogue/Details/" + id;
}
</script>
Wednesday, April 10, 2013
Friday, March 8, 2013
What Blogging is to me
Blogging is a confusing internet medium. It has been overtaken by newer personal communication sites (twitter and facebook) and quick professional communication (linkedin and message boards). Yet, blogs are still a hub for information from the famous blogger and big news blogs. For the less famous, blogging is a diary-like to log personal ideas. I have seen bloggers talking about life experience and life events, personal opinions (religion, politics and all of the fun stuff). There is also the brand marketing that is disguised as blogging. It is a smart way to advertise a a site while offering the information.
My new goal is to brain dump what I have. I want to build up my momentum and write. It will take a lot of practice to become a good writer and I will start now.
So.. Why am I blogging?
I don't know. I started this as a part of a class requirement when I was a student and I enjoy some parts of it and dislike the other.
Like: I seem to enjoy going back and seeing my past self was thinking. It is a good way to solve problems and helping my confidence. It also brings events and skills back to memory.
Dislike: the stress. I don't know my Target audience and the fact that anyone can Google me and find my Blogger is terrifying I am aware that I am a bad writer and my confidence is blocking me. The thought that someone would find my blog and find a spelling error is scary. The only way for me to improve is by writing and I feel as going back and over proof read my blog to be tiring. So I just give up and not publish my blogs. I have no readers now and I have more drafts than posts.
Tuesday, March 5, 2013
Uploading files to your website and saving them on a sharepoint folder (or any folder)
I ran into a requirement where I had to implement an email attachment like feature on my web page. The user should be able to upload and retrieve a the file. We chose Sharepoint to be the host for the files.
I never worked with Sharepoint before and I felt as using the ms libraries would be complicated. Thankfully, the whole process was easier than what I expected as it is all .NET. It boils down to moving a file from one folder to another folder in a directory in the server.
Bellow is a snippet if code that would accomplish the task (I will format it later. I wish the option was in blogger)
string location = WebConfigurationManager.AppSettings["IssueTrackingSharepointFolderLocation"];//Shared Documents";
// Some browsers send file names with full path. We only care about the file name.
var fileName = Path.GetFileName(file.FileName);
string[] combinedPath = new string[3];
combinedPath[0] = location;
//handle the month if iti s less than 10 and add a 0 to it
if (date.Month < 10)
{ combinedPath[1] = date.Year.ToString() + "0" + date.Month.ToString(); }
else
{ combinedPath[1] = date.Year.ToString() + date.Month.ToString(); }
combinedPath[2] = entity.IssueAttachmentID.ToString() + "." + GetFileNameExtension(fileName); //get the key with the extension
string destinationPath = Path.Combine(combinedPath);
string directoryPath = Path.Combine(combinedPath[0], combinedPath[1]);
Directory.CreateDirectory(directoryPath);
I never worked with Sharepoint before and I felt as using the ms libraries would be complicated. Thankfully, the whole process was easier than what I expected as it is all .NET. It boils down to moving a file from one folder to another folder in a directory in the server.
Bellow is a snippet if code that would accomplish the task (I will format it later. I wish the option was in blogger)
string location = WebConfigurationManager.AppSettings["IssueTrackingSharepointFolderLocation"];//Shared Documents";
// Some browsers send file names with full path. We only care about the file name.
var fileName = Path.GetFileName(file.FileName);
string[] combinedPath = new string[3];
combinedPath[0] = location;
//handle the month if iti s less than 10 and add a 0 to it
if (date.Month < 10)
{ combinedPath[1] = date.Year.ToString() + "0" + date.Month.ToString(); }
else
{ combinedPath[1] = date.Year.ToString() + date.Month.ToString(); }
combinedPath[2] = entity.IssueAttachmentID.ToString() + "." + GetFileNameExtension(fileName); //get the key with the extension
string destinationPath = Path.Combine(combinedPath);
string directoryPath = Path.Combine(combinedPath[0], combinedPath[1]);
Directory.CreateDirectory(directoryPath);
Labels:
ado.net c# sharepoint code
Friday, January 25, 2013
Startup Weekend CLT
I decided to try a new thing on the weekend. I went to Startup Weekend. An event where anyone can pitch an idea and work on for the chance of winning funding and other perks and fun. The event took place in Packard Place in downtown Charlotte. I did not have any ambitions of starting my own business (yet!) but I wanted to get exposed to the process in case I want to. I also wanted to improve my programming skills. The weekend was quite an adventure that I learned a lot from so I am going to talk about what happened and follow up with what I learned.
Day one - The Pitch:
Everyone with an idea were given a minute to pitch. I decided to go for it as I don't get a chance to practice my public speaking skills every day so I went for it. After an adrenaline rush that lasted for over 30 minutes, I pitched my idea and I did not know how to explain it and it got lost in the sea of pitches. It was really bad.
After voting for the top pitches, We had to join a team that we are interested in working with. It was tricky given that I had no interest in any of the ideas so I chose a team that needed a web developer and had other developers that I could learn from. We did not win and I really don't regret not choosing another team. I came to the event to sharpen my skills and I think I worked on a really challenging product.
Day 2: The head down coding phase:
Now that the plan is set, we divided our team to handle the development, marketing, bushiness planning and research. I decided to handle the web development given that we already had 3 developers in the team who handled the Android app and the back end of the server.. ... I was able to pull a quick web layout thanks to bootstrap and Google maps. I used Google charts for the first time and it was really easy to use.
Day 3: The catching up:
The last day. We did not code freeze and it felt as if we were moving the last pieces of a jinga game. I finished up my web development and we were really impressed by how fast we finished the product.
The presentation went better than what I expected. The marketing and project management guys were able to research the product and pulled a really nice presentation.
We did not win the contest ... But I learned a lot and met amazing people.

Lessons learned:
Day one - The Pitch:
Everyone with an idea were given a minute to pitch. I decided to go for it as I don't get a chance to practice my public speaking skills every day so I went for it. After an adrenaline rush that lasted for over 30 minutes, I pitched my idea and I did not know how to explain it and it got lost in the sea of pitches. It was really bad.
Pitch 27: App that allows a group of friends to divide the planning for the evening.#csw5
— Startup Weekend CLT (@StartupWkndCLT) January 26, 2013
After voting for the top pitches, We had to join a team that we are interested in working with. It was tricky given that I had no interest in any of the ideas so I chose a team that needed a web developer and had other developers that I could learn from. We did not win and I really don't regret not choosing another team. I came to the event to sharpen my skills and I think I worked on a really challenging product.
Day 2: The head down coding phase:
Now that the plan is set, we divided our team to handle the development, marketing, bushiness planning and research. I decided to handle the web development given that we already had 3 developers in the team who handled the Android app and the back end of the server.. ... I was able to pull a quick web layout thanks to bootstrap and Google maps. I used Google charts for the first time and it was really easy to use.
Day 3: The catching up:
The last day. We did not code freeze and it felt as if we were moving the last pieces of a jinga game. I finished up my web development and we were really impressed by how fast we finished the product.
The presentation went better than what I expected. The marketing and project management guys were able to research the product and pulled a really nice presentation.
We did not win the contest ... But I learned a lot and met amazing people.
Lessons learned:
- I am not the only one with a "great" idea. Over half of the crowed came up to pitch and I actually liked a lot of the ideas that were not selected.
- I should practice my pitch. I failed at communicating my idea to the public and this is what they thought it was (reminder: it was about creating a bucket list for friends)
- I should be passionate about my pitch and I should show it.
- Focus on solving problems
- Prove a track record of what I done before to support my pitch.
- Think about which team to join and what project I could add the most value to.
- Bring in my business cards. I regret not marketing myself. Especially given the melting pot nature of talented people that I could network with.
- Bring in more of my friends. Knowing people makes it easier to jump into conversations and meet others.
- Take breaks and stay healthy. I think I might bring some board games to play with the team while taking breaks.
- Know my technologies and have suggestions for common solutions (web hosting, layouts, social marketing).
- Learn about technologies that are common among other start ups (Javascript, Ruby, mobile development, facebook Graph API).
- Read the rules... yeah.
Great quotes I heard (paraphrasing for some of them):
"Your customers will not move away from the bad process they are following because it works. You have to make your product a 100 times better before they will adopt it." - Tim Cheadle
"The biggest mistake you could make in start up weekend is to actually work on implementing your product"
List of skills and technologies I got exposed to:
Bootstrap: I used it before but I never created a full project with it. It is a great way to prototype websites. There are a lot of great templates and themes ready to use.
Google Charts: a great way to charts. We used it to plot a pie graph of the categories and a Bar graph for the spending. We ran into an API key issue but we fixed it.
Google Maps API: Used to show multiple transaction locations.
Android Geolocation: I had to get the coordination to plot them on the map. Google resources were really helpful.
prezi: A great presentation tool.
Monday, January 21, 2013
Podcasts
I have always enjoyed talk shows but I have no interest in the topics presented. NPR has multiple good shows but I find it hard to plan my day around the radio shows (I don't do that for TVs either!). I starting listening to gaming podcasts and it led me into a whole ocean of podcast about all different topics. I tried rooting my android phone and I ended up losing all of my podcast.
I am going to create a list here and share my favorite topics with all of you:
Random Information and facts:
How Stuff Works
Nostalgia-Nerd Culture:
Laser Time
Programming:
This developer life
Hanselminute
.Net Rocks
Thirsty Developer
Money:
Clark Howard
Dave Ramsey
montlyfool
freakonomics
NPR:
Car Talk
This American Life
gaming:
Giant bombcats
8-4 Play
games dammit
Player one podcast
Retronauts
Electronic music (stay away):
UKF
Tiesto's club life
Science:
StarTalk
TV shows:
The Talking Dead
Dexter
WhyAmIListeniongToThis:
Joe Rogan Experience
Ratchet & The Geek
History:
Hardcore History with Dan Carlin
Comedy:
The Nerdist.
I am going to create a list here and share my favorite topics with all of you:
Random Information and facts:
How Stuff Works
Nostalgia-Nerd Culture:
Laser Time
Programming:
This developer life
Hanselminute
.Net Rocks
Thirsty Developer
Money:
Clark Howard
Dave Ramsey
montlyfool
freakonomics
NPR:
Car Talk
This American Life
gaming:
Giant bombcats
8-4 Play
games dammit
Player one podcast
Retronauts
Electronic music (stay away):
UKF
Tiesto's club life
Science:
StarTalk
TV shows:
The Talking Dead
Dexter
WhyAmIListeniongToThis:
Joe Rogan Experience
Ratchet & The Geek
History:
Hardcore History with Dan Carlin
Comedy:
The Nerdist.
Friday, October 5, 2012
How to get market your product
A good product would be used because it is good
I have seen a lot of advertisement about products that don't function correctly and I quit them so early. I am a gamer and I have to wash my eyes after looking at the Facebook ads. There is no way I am giving your Facebook game a chance. I played mafia wars and I already know what those free to play games are. If you want to get a good following then spend the money on improving the product or the model you are using. I have used many products that were reccomended to me by my friend. I have used dropbox for one reason. It is awesome. It solves a problem and I will share my dropbox with my friends. Not because it is good, but because I care about my friends and I want them to use a good. WE WANT TO USE YOUR PRODUCTS BECAUSE THEY ARE GOOD.Monday, September 24, 2012
Reading Information from a webconfig file in asp.net
Every once in a while, we would like to keep some of the application settings in a web config file to handle tasks like Database location and file location. Here is a quick way too read from a Web.config file
<!-- Somewhere in the web.config fole -->
<appSettings>
<add key="NameOfTheKey" value="Value"/>
<add key="FooKey" value="\\folder\Shared Documents"/>
</appSettings>
Here is how to get the file in C#
string location = WebConfigurationManager.AppSettings["NameOfTheKey"]; //location will be "Value"
Hope that helps
Subscribe to:
Posts
(
Atom
)